added doc for grouping function