Finally got the aggregation right