                 parentNode = nodeMap[parent.name]
                 node.parent = parentNode
                 parentNode.children.push(node)
+            else
+                topNodes.push(node)
 
     r = 40
 



drawTree = (svg, tree) ->
    nodes = []
    nodeMap = {}


                node.x = xMin + node.width / 2
                node.y = yMin + node.height / 2

        for node in nodes
            doCollisions(node.children)

        doCollisions(topNodes)

        svg.selectAll('.cell')
            .attr('transform', (node) -> "translate(#{node.x},#{node.y})")
