Total and sum handling