     node.terms = terms
     return node
 
+  # Drawing node representing addition.
   class Add extends DrawingNode
+
+    # Make a new Add drawing node.
+    #
+    # @param terms... [Array<DrawingNode>] Drawing nodes to add together.
+    # @return [Add] A new addition drawing node.
     constructor: (@terms...) ->
 
+    # How strongly bound the node is.
+    #
+    # @return [Number] Binding strength.
     bindingStrength: ->
       4
 
+    # Draw the node as a LaTeX string.
+    #
+    # @return [String] This node drawn as LaTeX.
     renderLaTeX: ->
       return @terms.map((x) -> x.renderLaTeX()).join(" + ")
 
+    # Draw the node as a string.
+    #
+    # @return [String] This node drawn as a string.
     renderString: ->
       return @terms.map((x) -> x.renderString()).join(" + ")
 
+    # Draw the node as a MathML string.
+    #
+    # @return [String] This node drawn as MathML.
     renderMathML: ->
       return @terms.map((x) -> x.renderMathML())
                    .join("<mo>+</mo>")
 
+  # Drawing node representing multiplication.
   class Mul extends DrawingNode
+
+    # Make a new multiplication drawing node.
+    #
+    # @param terms... [Array<DrawingNode>] Drawing nodes to multiply together.
+    # @return [Mul] A new multiplication drawing mode.
     constructor: (@terms...) ->
 
+    # How strongly this node is bound.
+    #
+    # @return [Number] Binding strength.
     bindingStrength: ->
       6
 
+    # Draw the node as a LaTeX string.
+    #
+    # @return [String] This node drawn as LaTeX.
     renderLaTeX: ->
       return @terms.map((x) -> x.renderLaTeX()).join(" \\cdot ")
 
+    # Draw the node as a string.
+    #
+    # @return [String] This node drawn as a string.
     renderString: ->
       return @terms.map((x) -> x.renderString()).join("*")
 
+    # Draw this node as a MathML string.
     renderMathML: ->
       return @terms.map((x) -> x.renderMathML()).join("<mo>&middot;</mo>")
 
+  # Drawing node representing exponentiation.
   class Pow extends DrawingNode
+
+    # Make a new exponentiation drawing node.
+    #
+    # @param left [DrawingNode] The base of the power node.
+    # @param right [DrawingNode] The exponent of the power node.
+    # @return [Pow] A new exponentiation drawing node.
     constructor: (@left, @right) ->
 
+    # Draw the node as a LaTeX string.
+    #
+    # @return [String] This node drawn as LaTeX.
     renderLaTeX: ->
       "#{@left.renderLaTeX()}^{#{@right.renderLaTeX()}}"
 
+    # Draw the node as a string.
+    #
+    # @return [String] This node drawn as a string.
     renderString: ->
       "#{@left.renderString()}**#{@bracketIfNeeded(@right).renderString()}"
 
+    # Draw the node as a MathML string.
+    #
+    # @return [String] This node drawn as MathML.
     renderMathML: ->
       "<msup>#{@left.renderMathML()}#{@right.renderMathML()}</msup>"
 
-
+  # Drawing node representing bracketing.
   class Bracket extends DrawingNode
+
+    # Make a new bracket drawing node.
+    #
+    # @param contents [Array<DrawingNode>] Drawing nodes inside the brackets.
+    # @return [Bracket] A new bracket node.
     constructor: (@contents) ->
 
+    # How strongly bound this node is.
+    #
+    # @return [Number] Binding strength.
     bindingStrength: ->
       9
 
+    # Draw the node as a LaTeX string.
+    #
+    # @return [String] This node drawn as LaTeX.
     renderLaTeX: ->
       return "\\left(#{@contents.renderLaTeX()}\\right)"
 
+    # Draw the node as a string.
+    #
+    # @return [String] This node drawn as a string.
     renderString: ->
       return "(#{@contents.renderString()})"
 
-    renderMathML: ->
-      return "<mfenced><mrow>#{@contents.renderMathML()}" +
-                                                                "</mrow></mfenced>"
-
+    # Draw the node as a MathML string.
+    #
+    # @return [String] This node drawn as MathML.
+    renderMathML: ->
+      return "<mfenced><mrow>#{@contents.renderMathML()}</mrow></mfenced>"
+
+  # Drawing node representing a number.
   class Number extends DrawingNode
-    constructor: (@value) ->
-
+
+    # Make a new number drawing node.
+    #
+    # @param value [Number] The value of the number.
+    # @param classname [String] Optional. The name that should be set as the class for this node if drawn as MathML or similar.
+    # @return [Number] A new drawing node representing this number.
+    constructor: (@value, @classname="constant") ->
+
+    # How strongly this node is bound.
+    #
+    # @return [Number] Binding strength.
     bindingStrength: ->
       10
 
+    # Draw the node as a LaTeX string.
+    #
+    # @return [String] This node drawn as LaTeX.
     renderLaTeX: ->
       return @value+""
 
+    # Draw the node as a string.
+    #
+    # @return [String] This node drawn as a string.
     renderString: ->
       return @value+""
 
-    renderMathML: ->
-      return "<mn class=\"constant\">#{@value}</mn>"
-
+    # Draw the node as MathML.
+    #
+    # @return [String] This node drawn as MathML.
+    renderMathML: ->
+      return "<mn class=\"#{@classname}\">#{@value}</mn>"
+
+  # Drawing node representing a variable.
   class Variable extends DrawingNode
+
+    # Make a new variable drawing node.
+    #
+    # @param label [String] The label of this variable.
+    # @param classname [String] Optional. The name that should be set as the class for this node if drawn as MathML or similar.
+    # @return [Variable] A new variable drawing node.
     constructor: (@label, @classname="variable") ->
 
+    # How strongly this node is bound.
+    #
+    # @return [Number] Binding strength.
     bindingStrength: ->
       10
 
+    # Draw the node as a LaTeX string.
+    #
+    # @return [String] This node drawn as LaTeX.
     renderLaTeX: ->
       # Check for Greek characters.
       mlabel = ""

          mlabel += char
      return mlabel

    renderString: ->
      return @label

    renderMathML: ->
      labelArray = @label.split("-")
      label = labelArray[0]

      else
        return '<mi class="' + @classname + '">' + label + '</mi>'

  # Drawing node representing a fraction.
  class Fraction extends DrawingNode
    
    # Make a new fraction drawing node.
    #
    # @param top [DrawingNode] The node to be drawn on top of the fraction.
    # @param bottom [DrawingNode] The node to be drawn on the bottom of the fraction.
    # @return [Fraction] A new fraction drawing node.
    constructor: (@top, @bottom) ->

    # How strongly this node is bound.
    #
    # @return [Number] Binding strength.
    bindingStrength: ->
      8

    # Draw the node as a LaTeX string.
    #
    # @return [String] This node drawn as LaTeX.
    renderLaTeX: ->
      return "\\frac{#{@top.renderLaTeX()}}{#{@bottom.renderLaTeX()}}"

    # Draw the node as a string.
    #
    # @return [String] This node drawn as a string.
    renderString: ->
      return "#{@bracketIfNeeded(@top).renderString()}/#{@bracketIfNeeded(@bottom).renderString()}"

    # Draw the node as MathML.
    #
    # @return [String] This node drawn as MathML.
    renderMathML: (x,y) ->
      "<mfrac>
      <mrow>#{@top.renderMathML(x,y)}</mrow>
