added basic grouping support