updated Group function to appropriately collapse hidden groupings.