       ixs[0].object.lines.push(@placingLink.ln)
       
       @placingLink.endpoint[1] = ixs[0].object.userData
+      @placingLink.endpoint[1].links.push(@placingLink)
 
       @ve.surface.updateLink(@placingLink.ln)
       @placingLink.ifInternetToWanLink()
       @placingLink.setEndpointData()
 
-      ###
-      if @placingLink.endpoint[0] instanceof BaseElements.Router and
-        @placingLink.endpoint[1] instanceof BaseElements.Router
-          @placingLink.props.latency = 7
-      else
-        @placingLink.props.capacity = 1000
-      ###
-           
+      @ve.addie.update(@placingLink)
+
 
       @ve.container.onmousemove = null
       @ve.container.onmousedown = (eve) => @baseDown(eve)

      @ln.obj3d.userData = this
      @props = {
        name: "link0",
        capacity: 1000,
        a_name: null,
        a_sys: null,
        b_name:null,
        b_sys: null,
        latency: null
      }
      @id = {
        name: "link0"

      console.log(data)
      x.id.name = x.props.name
      x.id.sys = x.props.sys

    updateLink = (l) =>
      l.setEndpointData()
      @update(l)


    if x.links?
      updateLink(l) for l in x.links

    true

#Mouse handler encapsulates the logic of dealing with mouse events
class MouseHandler
