added functionality to aggregate