add grouping funcitonality and associated tests