Polishing hw 3 on data aggregation