added category totals functionality