now outputs totals instead of arrays