totals fix and faster output