corrected selectionSort()