Finding this a hard read. The implication that item.Value.Next == null implies you get the total from a different property must from some convention that I don't yet know on the way the data is arranged in the data structure.