always use the user's comparator for better polymorphism