   long done = 2000;
   int i, j;
   // find closest road.
-  for (i = 0; i < MAP_POINTS; i++)
+  for (i = 0; i < map_points; i++)
   {
     dist = distance(i, &j, start->east_mm, start->north_mm, &perCent);
     if (abs(dist) < abs(closest_mm))

 }
  else
  { // find closest node
     for (i = 0; i < MAP_POINTS; i++)
    {
      dist = start->distance_mm(Nodes[i].east_mm, Nodes[i].north_mm);
      if (dist < closest_mm)

  Origin.east_mm = 0;
  Origin.north_mm = 0;  
  Origin.latitude = INVALID;
  Origin.longitude = INVALID; 
  struct junction nodeList[MAX_WAYPOINTS] =  {
    -140828,  221434, 3 ,   1 ,  END,  END,  1, 1, 1, 1,  // 0
    -140986,   88800, 0 ,   2 ,   5 ,  END,  1, 1, 1, 1,  // 1
    -144313,  -42065, 1 ,   6 ,  END,  END,  1, 1, 1, 1,  // 2
    -78568,   222090, 0 ,   4 ,  END,  END,  1, 1, 1, 1,  // 3
    -38276,   222290, 3 ,   5 ,  END,  END,  1, 1, 1, 1,  // 4
    -39558,    87844, 1 ,   4 ,   8 ,   6 ,  1, 1, 1, 1,  // 5
    -46528,   -41631, 2 ,   5 ,   7 ,   9 ,  1, 1, 1, 1,  // 6
    -45764,  -135413, 6 ,   10,  END,  END,  1, 1, 1, 1,  // 7
    51834,     87232, 5 ,   9 ,   14,  END,  1, 1, 1, 1,  // 8
    53041,    -41220, 6 ,   8 ,   10,  13 ,  1, 1, 1, 1,  // 9
    53438,   -133901, 7 ,   9 ,   11,  END,  1, 1, 1, 1,  // 10
    108750,  -134590, 10 , 12 ,  END,  END,  1, 1, 1, 1,  // 11
    130021,  -143108, 11 , END,  END,  END,  1, 1, 1, 1,  // 12
    182559,   -41031, 9 ,  END,  END,  END,  1, 1, 1, 1,  // 13
    177598,    86098, 8 ,   15,  END,  END,  1, 1, 1, 1,  // 14
    170313,    69008, 14 , END,  END,  END,  1, 1, 1, 1   // 15
  };
  for (int i = 0; i < map_points; i++)
  {
    Nodes[i] = nodeList[i];
  }
  
     ConstructNetwork(Nodes, map_points);
     
  /* If (initial position is provided)  // used when GPS is unavailable or inaccurate
     {
