fixed issue with selection sort for ranking.