perfect pair finding