selection sort in scala