Transposed over the quicksort to make sortByRating truly work