added abstract_compare method