fixing rankings functions to return the sorted list