working and with totals