with two compare funcitons