clean up for selection sort