     new_node.id = id
     nodes[id] = new_node
   open_nodes = [start]
-  nodes[start].g = 0
-  nodes[start].f = distance(nodes[start].lat, nodes[start].lon, nodes[end].lat, nodes[end].lon)
+  start_node = nodes[start]
+  end_node = nodes[end]
+  start_node.g = 0
+  start_node.f = distance(start_node.lat, start_node.lon, end_node.lat, end_node.lon)
 
   count = 0
-  start_node = nodes[start]
-  end_node = nodes[end]
   while open_nodes.length > 0
     count++
     # Sort the working nodes by f


  # Copy the array of intersections
  nodes = []
  console.log "copy begin"
  for id, node of intersections
    new_node = []
    for prop, val of node

console.log("Processing")

exports.nav = (req, res) ->
  start = parseInt(req.query.start)
  end = parseInt(req.query.end)
  res.send(astar(start, end))

astar = (start, end) ->
