tidy up steps. Included comments
Implemented step 5: aggregation