selection sort in swift