fixed swapping error in selection sort