Updated total calculation