added grouping for statistics