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

            .attr('y', (node) -> - node.height / 2)
            .attr('width', (node) -> node.width)
            .attr('height', (node) -> node.height)


collide = (node) ->

    ny2 = node.y + r

    fn = (quad, x1, y1, x2, y2) ->
        other = quad.point
        if other and (other != node)
            dx = node.x - other.x
            dy = node.y - other.y
            l = Math.sqrt(dx * dx + dy * dy)
            r = d3.max([node.width + other.width, node.height + other.height]) / 2
            if l < r  # found a collision
                l = (l - r) / l * .5
                node.x -= (dx *= l)
                node.y -= (dy *= l)
                other.x += dx
                other.y += dy
        return x1 > nx2 or x2 < nx1 or y1 > ny2 or y2 < ny1

    return fn
