wip: calculates total.