added functions for get_d_count_grpby_level2 and d_child_counts