rewrote SelectionSort