Corrected grouping template