add implementation for aggregation