comparator working