update Compare method and its sub-methods