added math for cumulative categories