implements totals