fixed two pair comparing logic