fixing print-out of totals