Updating the sample code to include some aggregation.