Added working selectionSort method