add support for custom comparator