add comparator in TreeCounter