def all_children_count
      size = subsegments.count
      subsegments.each { |v| size += v.all_children_count }
      size
    end
def all_children_count
      size = subsegments.count
      subsegments.each { |v| size += v.all_children_count }
      size
    end
Returns the number of its direct and indirect children.
 This is useful when we remove the reference to a subsegment
 and need to keep remaining subsegment size accurate.