Index: branches/FEPSimulator/FEPSim.cpp
===================================================================
--- branches/FEPSimulator/FEPSim.cpp	(revision 217)
+++ branches/FEPSimulator/FEPSim.cpp	(revision 219)
@@ -33,25 +33,24 @@
     vector<STATION*> ldsMap = highwaysParser.stations;
 
-    
     // Send one reply for every FEPLine
     for (int i = 0; i < lines.size(); i++) {
         fep_reply fepReply;
-        
+        FEP_LINE * currLine = lines.at(i);
         // populate reply
         fepReply.reply = SHORTPOLL;
-        fepReply.schedule = lines.at(i)->schedule;
-        fepReply.lineinfo = lines.at(i)->lineInfo;
+        fepReply.schedule = currLine->schedule;
+        fepReply.lineinfo = currLine->lineInfo;
         fepReply.kind = (enum polltype) 0;
         fepReply.flag = (enum replykind) 0;
 
-        fepReply.schedule_sequence = lines.at(i)->schedleSeq;
-        fepReply.global_sequence = lines.at(i)->globalSeq;
+        fepReply.schedule_sequence = currLine->schedleSeq;
+        fepReply.global_sequence = currLine->globalSeq;
 
         // using current unix time, may need to look at later
         fepReply.schedule_time = time(NULL);
 
-        fepReply.user_info1 = lines.at(i)->lineNum;
-        fepReply.user_info2 = lines.at(i)->lineNum;
-        fepReply.system_key = lines.at(i)->systemKey;
+        fepReply.user_info1 = currLine->lineNum;
+        fepReply.user_info2 = currLine->lineNum;
+        fepReply.system_key = currLine->systemKey;
 
         fepReply.answers.size = 1;
@@ -59,17 +58,17 @@
 	
         // construct a shortanswer for each station in line
-        for (int j = 0; j < lines.at(i)->lds.size(); j++) {
+        for (int j = 0; j < currLine->lds.size(); j++) {
             fep_shortanswer fsa;
-            int index = lines.at(i)->ldsIndex.at(j);
+            STATION * currStation = ldsMap.at(currLine->ldsIndex.at(j));
 
-            // msg: oa, od, ldsMap.at(index).dataPack, od, ff
-            fsa.msg.message_len = ldsMap.at(index)->length + 2;
+            // msg: oa, od, currStation.dataPack, od, ff
+            fsa.msg.message_len = currStation->length + 2;
             fsa.msg.message[0] = 0x0d;
             fsa.msg.message[1] = 0x0a;
-            for (int k = 0; k < ldsMap.at(index)->length; k++) {
-		//printf("Adding: %d %02X\n", k, ldsMap.at(index)->dataPack[k]);	
-                fsa.msg.message[2 + k] = ldsMap.at(index)->dataPack[k];
+            for (int k = 0; k < currStation->length; k++) {
+		//printf("Adding: %d %02X\n", k, currStation->dataPack[k]);	
+                fsa.msg.message[2 + k] = currStation->dataPack[k];
             }
-            int aa = ldsMap.at(index)->length;
+            int aa = currStation->length;
             fsa.msg.message[2 + aa] = 0x0d;
             fsa.msg.message[3 + aa] = 0xff;
@@ -83,5 +82,5 @@
             // info
             fsa.info.poll_error_count = 0;
-            fsa.info.poll_user_info1 = ldsMap.at(index)->drop; // drop number
+            fsa.info.poll_user_info1 = currStation->drop; // drop number
             fsa.info.poll_user_info2 = 1; //always 1
             fsa.info.retries = 0;
@@ -91,7 +90,7 @@
             // send out data
             
-            FEPLogFile << "Sending fepReply for line #" << lines.at(i)->lineNum 
+            FEPLogFile << "Sending fepReply for line #" << currLine->lineNum 
                     << " station number #" 
-                    << ldsMap.at(lines.at(i)->ldsIndex.at(j)) << endl;
+                    << ldsMap.at(currLine->ldsIndex.at(j)) << endl;
             
             // Transfer the station data to ATMS and listen for response
@@ -190,9 +189,9 @@
             exit(1);
         }
-        
+        // open log file
         FEPLogFile.open(FEPLogFileName, ios::app);
         // send data to atms
         manageClientConnection(buffer);
-        FEPLogFile << "attempt" << endl;
+        // close log file
         FEPLogFile.close();
     }
Index: branches/FEPSimulator/network.h
===================================================================
--- branches/FEPSimulator/network.h	(revision 159)
+++ branches/FEPSimulator/network.h	(revision 219)
@@ -84,4 +84,3 @@
 };
 
-
 #endif
