         # child tile.
         parent.tile.value.child = createTile parent, 'siblingless', true
     
-    addLeavesToLeaf = (parent) ->
+    addLeavesToLeaf = (parent, orientation) ->
         # Create two tiles; convert the 'leaf' tile into a 'branch' tile
         # before inserting the two new 'leaf' tiles into the newly-classified
         # 'branch' tile.

                .attr 'id', 'tael-node-0'
]

newTile = (tiles, parent_id) ->
    # Add a new tile to the `tiles` array.
    setTileClass = (tile, side) ->
        # Set the class of a tile which is represented as a `ref`.

        parent.tile.value =
            type: 'branch'
            children:
                left: createTile parent, orientation, true
                right: createTile parent, orientation, false
            content:
                dom:
                    parent.tile.value.content.dom
                    .attr 'class', 'tael-node-branch'
            layout:
                split: orientation
                divider_location: 0.5
    
    parent =
