Created rank_hist and has_pair functions.