moved the comparator to a field to reuse instead of creating lots of them