wrote selection sort