Trying selection sort in ruby