Sensible sorting for ranking