implements computeTotal