function pointer to use custom comparators