Modification to grouping logic, so that we actually read the grouping value and the aggregation value