a good comparing logic.