 //   contains the origins and file names of the maps. 
 // Determines which origin is closest to the waypoint and returns it as a junction.
 // Assumes the file is in the correct format according to the description above.
-char* SelectMap(waypoint currentLocation, char* fileName)
+void SelectMap(waypoint currentLocation, char* fileName, char* nearestMap)
 {
   // open the file. note that only one file can be open at a time,
   // so you have to close this one before opening another.

     
  /* Convert latitude and longitude positions to flat earth coordinates.
     Fill in waypoint structure  */
//       GetGoals(mission, CONES);
       
       // Send mission to C3.
       SendPath(mission, CONES);


    // Null terminate the buffer string
    *ptr = '\0';
    
    // Set up tokenizer for the file buffer string
    char delimiter[2] = ",";
    char* token;
    int col = 0;
    int row = 0;
    
    // get the first token 
    token = strtok(buffer, delimiter);
    
    // walk through other tokens
    while( token != NULL && row < MAX_WAYPOINTS ) 
    {
      switch (col % 10)
      {
        case 0:  // latitude
        Nodes[row].east_mm = atol(token);
        col++;
        break;
        
        case 1:  // longitude
        Nodes[row].north_mm = atol(token);
        col++;
        break;
        
        case 2:  // filename
        if (token == "END")
        {
          Nodes[row].destination[0] = END;
        }
        else
        {
          Nodes[row].destination[0] = atoi(token);
        }
        col++;
        break;
        
        case 3:  // filename
        if (token == "END")
        {
          Nodes[row].destination[1] = END;
        }
        else
        {
          Nodes[row].destination[1] = atoi(token);
        }
        col++;
        break;

        case 4:  // filename
        if (token == "END")
        {
          Nodes[row].destination[2] = END;
        }
        else
        {
          Nodes[row].destination[2] = atoi(token);
        }
        col++;
        break;

        case 5:  // filename
        if (token == "END")
        {
          Nodes[row].destination[3] = END;
        }
        else
        {
          Nodes[row].destination[3] = atoi(token);
        }
        col++;
        break;

        case 6:  // filename
        Nodes[row].Distance[0] = atol(token);
        col++;
        break;

        case 7:  // filename
        Nodes[row].Distance[1] = atol(token);
        col++;
        break;

        case 8:  // filename
        Nodes[row].Distance[2] = atol(token);
        col++;
        break;

        case 9:  // filename
        Nodes[row].Distance[3] = atol(token);
        col++;
        row++;
        break;

        default:  // unexpected condition; print error
        Serial.println("Unexpected error happened while reading map description file. Please verify the file is in the correct format. Planner may not work correctly if this message appears.");
        break;
      }
      token = strtok(NULL, delimiter);
    }
    map_points = row;
    
    // If file loaded, read data into Nodes[]
    free(buffer);
    myFile.close();
