ranks pairings, refactors and adds to pairing algo