additional implementation of hash lookup in pair.c