modified comparator.