updated comparator