def add_levels(elements, level=1)
      elements.each do |e|
        e.options[:element_level] = level
        add_levels(e.children, level+1)
      end
    end
def add_levels(elements, level=1)
      elements.each do |e|
        e.options[:element_level] = level
        add_levels(e.children, level+1)
      end
    end
Adds a 'level' option to all elements to show how nested they are