called compare twice for no reason so made it only call it once