implemented SelectionSort