This is a sorthing algorithm, it orders numbers from smallest to largest. The algorithm goes to all the numbers and sets the smallest value it can find to the recent smallest.