commented code for aggregator