Fixing selection sort algorithm

fixing selection sort algorithm