Added toggle to turn grouping on and off