added counting and grouping tests