finish selection sort