fixing two-pair comparison