Add compare method.