improve totals calculations