aggregation code update