updated to aggregate the mean values