Finished cohort 2 code, added code to aggregate by category