small changes to get_pair