 				.style('marker-start', (edge) -> if edge.left then 'url(#startArrow)' else '')
 				.style('marker-end', (edge) -> if edge.right then 'url(#endArrow)' else '')
 				.on 'mousedown', (edge) ->
-					# select link
 					mouseDownEdge = edge
-					selectedNode = null
 					restart()
 
 			# remove old links

				d3.select(this).attr 'transform', '' # unenlarge target node

			.on 'mousedown', (node) ->
				# select node
				mouseDownNode = node
				if mouseDownNode == selectedNode
					selectedNode = null
				else
					selectedNode = mouseDownNode

				# reposition drag line
				drag_line.style('marker-end', 'url(#endArrow)').classed('hidden', false).attr('d', 'M' + mouseDownNode.x + ',' + mouseDownNode.y + 'L' + mouseDownNode.x + ',' + mouseDownNode.y)
				restart()

		nodes = svg.append('svg:g').selectAll('g')

		# mouse event vars
		mouseDownEdge = null
		mouseDownNode = null
		mouseUpNode = null
