     # Because any node with children.length == 1 has
     # the same width as its child, we can skip those.
 
+    decision = @getNextDecision(tree)
+
     # Leaves just have a width of one
-    decisionPoint = @getNextDecisionPoint(tree)
-    if decisionPoint.children.length == 0
-      decisionPoint.width = 1
+    if decision.isLeaf
+      decision.node.width = 1
       return 1
+
+    decisionPoint = decision.node
+
+    # edge case: system is made for binary trees only
+    # allow a maximum of two
+    if decision.node.children.length > 2
+      decision.node.children = decision.node.children[0...2]
 
     # Branchpoints are as wide as its children combined.
     # But actually, we need the width of the children
-    result = 0
-    if decisionPoint.children.length > 2
-      decisionPoint.children = decisionPoint.children[0...2]
-
-    for child in decisionPoint.children
+    width = 0
+    for child in decision.node.children
       child.width = @recordWidths(child)
-      result += child.width
-    return result
+      width += child.width
+
+    return width
 
 
   getMaxTreeDepth : (tree, mode = @MODE_NORMAL, count = 0) ->

    @ctx.lineWidth = 1


  getNextDecisionPoint : (tree) ->

    # Decision point is any point with point.children.length != 1
    while tree.children.length == 1
      tree = tree.children[0]
    return tree


  recordWidths : (tree) ->

      @drawEdge(rootX, top, rootX, top + 0.5 * @nodeDistance)
      @drawChainIndicator(rootX, top + 0.5 * @nodeDistance, top + 1.5 * @nodeDistance, hasActiveNode)
      @drawEdge(rootX, top + 1.5 * @nodeDistance, rootX, top + 2 * @nodeDistance)
      @drawNode(rootX, top + 2 * @nodeDistance, decision.node.id)

    return { rootX, top }

