Adds compare method