finishing the grouping