finished selection sort