renamed options.comparator to options.compareFn