modified categorize to group by months and print total