modified comparator