added the grouping stuff