rewrite Ranking.checkPair for clarity and accuracy