           mouse_angle = angle(child.d3.x+x-startx, child.d3.y+y-starty, parent.d3.x, parent.d3.y)
           children_to_the_left = (child for child in parent.children when angleNode(graph.node(child),parent) > mouse_angle and child isnt graphUI.dragged)
           insert_at = children_to_the_left.length
-          console.log "insert_at: " + insert_at
           # Move node
           graph.moveNode(graphUI.dragged, graphUI.dropParent, insert_at)
         graphUI.redraw()

          d3.selectAll("#graph line[data-child='#{graphUI.dragged}']").remove()
          # Did we drop it in the trash?
          if intrash(".node[data-id=#{graphUI.dragged}]")
            console.log "AGH"
            deleteAll = (id)->
              node = graph.node(id)
              if node.children.length > 0

      graphUI.drawNodeAt(child.id, x-startx, y-starty)

      if intrash(".node[data-id=#{graphUI.dragged}]")
        $(".trashcan").addClass("dragover")
        graphUI.dropParent = null
        $("#graph .edge[data-child=#{child.id}]")
