Index: trunk/src/atmsdriver/model/TrafficEvent.java
===================================================================
--- trunk/src/atmsdriver/model/TrafficEvent.java	(revision 183)
+++ trunk/src/atmsdriver/model/TrafficEvent.java	(revision 184)
@@ -58,4 +58,5 @@
         return eventDate.compareTo(o.eventDate);
     }
+    
     @Override
     public String toString()
Index: trunk/src/atmsdriver/model/Station.java
===================================================================
--- trunk/src/atmsdriver/model/Station.java	(revision 180)
+++ trunk/src/atmsdriver/model/Station.java	(revision 184)
@@ -1,5 +1,4 @@
 package atmsdriver.model;
 
-import atmsdriver.ConsoleTrafficDriver;
 import atmsdriver.model.LoopDetector.DOTCOLOR;
 import java.util.List;
@@ -8,11 +7,11 @@
 
 /**
- *A Station (LDS or Loop Detector Station) represents a group of lane detectors
+ * A Station (LDS or Loop Detector Station) represents a group of lane detectors
  * across all lanes at a particular point on a highway.  A station is
  * identified by its highway number and postmile.  A station has an associated
  * direction used to establish which direction is Main and which is Opposite.
  * The MLTotVol and OppTotVol for a station can be dynamically updated.
- * A station has other attributes: lineNum, ldsID, drop, and location used
- * by the FEP.  A station can be compared to other stations by its postmile.
+ * A station has other attributes: lineNum, ldsID, drop, and location which are
+ * used by the FEP.  A station can be compared to other stations by its postmile.
  *
  * @author John A. Torres
@@ -54,4 +53,9 @@
     }
     
+    /**
+     * Calculates the total ML Volume.
+     * 
+     * @return total ML volume.
+     */
     private int getMLTotVol()
     {
@@ -67,4 +71,9 @@
     }
     
+    /**
+     * Calculates the total OPP Volume
+     * 
+     * @return total OPP volume.
+     */
     private int getOPPTotVol()
     {
@@ -170,6 +179,15 @@
             }
         }
-    }
-   
+        
+        this.MLTotVol = getMLTotVol();
+        this.OppTotVol = getOPPTotVol();
+    }
+    
+    /**
+     * Output for updateByDirection. Logs the update to the console.
+     * 
+     * @param dotcolor
+     * @param OPP_ML 
+     */
     private void outputUpdateMessage(DOTCOLOR dotcolor, String OPP_ML)
     {
@@ -181,4 +199,7 @@
     }
     
+    /**
+     * XML tags used for toXML() method.
+     */
     private static enum XML_TAGS
     {
@@ -203,5 +224,10 @@
         }
     }
-
+    
+    /**
+     * Returns the Station data in XMLFormat.
+     * 
+     * @param currElem The current XML <Station> element
+     */
     public void toXML(Element currElem)
     {
@@ -264,5 +290,4 @@
     public static enum DIRECTION
     {
-
         NORTH,
         SOUTH,
Index: trunk/src/atmsdriver/model/FEPLine.java
===================================================================
--- trunk/src/atmsdriver/model/FEPLine.java	(revision 103)
+++ trunk/src/atmsdriver/model/FEPLine.java	(revision 184)
@@ -1,53 +1,44 @@
 package atmsdriver.model;
 
+import java.util.ArrayList;
 import java.util.List;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-/** An FEPLine is a simulated line of communication from the FEP to 
- *  LoopDetectorStations in the traffic network.
- * 
- *  An FEPLine contains static meta data and a list of LoopDetectorStations.
- *  A single FEPLine contains multiple LoopDetectorStations.
+/**
+ * An FEPLine is a simulated line of communication from the FEP to
+ * Stations in the highways network.
+ *
+ * An FEPLine contains static line meta data and a list of Stations. A
+ * single FEPLine contains multiple Stations.
  *
  * @author John A. Torres
  * @version 09/10/2017
- */ 
-public class FEPLine {
+ */
+final public class FEPLine
+{
     /* Static FEPLine meta data */
     final public int lineNum;
     final public List<Station> stations;
     final private int count;
-    
-    final private int schedule;
-    final private int lineInfo;
-    final private long systemKey;
-    
-    // THESE WILL NEED TO BE UPDATED MAYBE, NOT SURE, NOT A PRIORITY. SEE METHOD
-    // UPDATESEQUENCES()
-    private long globalSeq;
-    private long scheduleSeq;
-    
-    public FEPLine(int lineNum, List<Station> stations, int count,
-            int schedule, int lineInfo, long systemKey, long globalSeq,
-            long scheduleSeq)
+
+    /**
+     * Constructs an FEPLine from given line number, list of stations, and count.
+     * 
+     * @param lineNum
+     * @param stations
+     * @param count 
+     */
+    FEPLine(int lineNum, ArrayList<Station> stations, int count)
     {
         this.lineNum = lineNum;
         this.stations = stations;
         this.count = count;
-        this.schedule = schedule;
-        this.lineInfo = lineInfo;
-        this.systemKey = systemKey;
-        this.globalSeq = globalSeq;
-        this.scheduleSeq = scheduleSeq;
     }
     
-    // NEED TO CHECK NUMBERS? DO WE EVEN NEED THIS?
-    public void updateSequences()
-    {        
-        this.scheduleSeq += 1;
-        this.globalSeq += 51;
-    }
-    
+    /**
+     * Returns the FEPLine meta data in string format
+     * @return FEPLine metadata
+     */
     public String getLineMeta()
     {
@@ -59,5 +50,5 @@
         build.append(Integer.toString(this.stations.size()));
         build.append("\n");
-        for(Station station : stations)
+        for (Station station : stations)
         {
             build.append(station.getStationMeta());
@@ -66,42 +57,27 @@
     }
     
+    /**
+     * Returns the FEPLine data in XMLFormat
+     * 
+     * @param currElem The current XML <Line> element
+     */
     public void toXML(Element currElem)
     {
         Document theDoc = currElem.getOwnerDocument();
-        
+
         Element lineElement = theDoc.createElement(XML_TAGS.LINE.tag);
         currElem.appendChild(lineElement);
-        
+
         Element lineNumElement = theDoc.createElement(XML_TAGS.LINE_NUM.tag);
         lineNumElement.appendChild(theDoc.createTextNode(String.valueOf(this.lineNum)));
         lineElement.appendChild(lineNumElement);
-        
+
         Element countElement = theDoc.createElement(XML_TAGS.COUNT.tag);
         countElement.appendChild(theDoc.createTextNode(String.valueOf(this.count)));
         lineElement.appendChild(countElement);
-        
-        Element scheduleElement = theDoc.createElement(XML_TAGS.SCHEDULE.tag);
-        scheduleElement.appendChild(theDoc.createTextNode(String.valueOf(this.schedule)));
-        lineElement.appendChild(scheduleElement);
-        
-        Element lineInfoElement = theDoc.createElement(XML_TAGS.LINE_INFO.tag);
-        lineInfoElement.appendChild(theDoc.createTextNode(String.valueOf(this.lineInfo)));
-        lineElement.appendChild(lineInfoElement);
-        
-        Element systemKeyElement = theDoc.createElement(XML_TAGS.SYSTEM_KEY.tag);
-        systemKeyElement.appendChild(theDoc.createTextNode(String.valueOf(this.systemKey)));
-        lineElement.appendChild(systemKeyElement);
-        
-        Element globalSeqElement = theDoc.createElement(XML_TAGS.GLOBAL_SEQ.tag);
-        globalSeqElement.appendChild(theDoc.createTextNode(String.valueOf(this.globalSeq)));
-        lineElement.appendChild(globalSeqElement);
-        
-        Element scheduleSeqElement = theDoc.createElement(XML_TAGS.SCHEDULE_SEQ.tag);
-        scheduleSeqElement.appendChild(theDoc.createTextNode(String.valueOf(this.scheduleSeq)));
-        lineElement.appendChild(scheduleSeqElement);
-        
+
         Element stationsElement = theDoc.createElement(XML_TAGS.STATIONS.tag);
         lineElement.appendChild(stationsElement);
-        for(Station station : stations)
+        for (Station station : stations)
         {
             station.toXML(stationsElement);
@@ -109,18 +85,17 @@
     }
     
+    /**
+     * XML Tags used in toXML()
+     */
     private static enum XML_TAGS
     {
+
         LINE("Line"),
         LINE_NUM("Line_Num"),
         STATIONS("Stations"),
-        COUNT("Count"),
-        SCHEDULE("Schedule"),
-        LINE_INFO("Line_Info"),
-        SYSTEM_KEY("System_Key"),
-        GLOBAL_SEQ("Global_Seq"),
-        SCHEDULE_SEQ("Schedule_Seq");
-        
+        COUNT("Count");
+
         String tag;
-        
+
         private XML_TAGS(String n)
         {
Index: trunk/src/atmsdriver/model/Highways.java
===================================================================
--- trunk/src/atmsdriver/model/Highways.java	(revision 180)
+++ trunk/src/atmsdriver/model/Highways.java	(revision 184)
@@ -1,7 +1,7 @@
 package atmsdriver.model;
 
-import atmsdriver.FEPLineLoader;
+import atmsdriver.model.Station.DIRECTION;
 import java.io.File;
-import java.io.FileWriter;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -13,6 +13,5 @@
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Observable;
-import java.util.Observer;
+import java.util.Scanner;
 import java.util.Set;
 import java.util.logging.Level;
@@ -29,65 +28,73 @@
 import tmcsim.common.SimulationException;
 
-/** The Highways class aggregates all Highway instances within a geographic
- *  region, and all of the FEPLines within an electronic detector 
- *  network, in the same geographic region. An instance of Highways.java 
- *  comprises the underlying model for the ATMSDriver application.
- * 
- *  Highways uses method writeToFEP() to communicate with the FEP Simulator. 
- *  It creates a socket client which sends the FEP Simulator a highways status
- *  message over the socket. This message is in the XML format required by the 
- *  FEP Simulator, which is provided by the resident toXML() method.
- * 
- *  Currently, there is no driving logic within the highways class. It is only
- *  done through an instance of the ConsoleDriver.java class. Eventually, it
- *  will receive incident data (from exchange.xml or better yet, directly from 
- *  the TMCSimulator itself) and drive the highways using resident logic.
+/**
+ * The Highways class aggregates all Highway instances within a geographic
+ * region, and all of the FEPLines within an electronic detector network, in the
+ * same geographic region. An instance of Highways.java comprises the underlying
+ * model for the ATMSDriver application.
+ *
+ * Highways uses method writeToFEP() to communicate with the FEP Simulator. It
+ * creates a socket client which sends the FEP Simulator a highways status
+ * message over the socket. This message is sent in the format required by the
+ * FEP Simulator.
+ *
+ * Currently, there is no driving logic within the highways class. It is only
+ * done through an instance of the ConsoleDriver.java class. Eventually, it will
+ * receive incident data (from exchange.xml or better yet, directly from the
+ * TMCSimulator itself) and drive the highways using resident logic.
  *
  * @author John A. Torres
  */
-public class Highways {
-
-    final private ArrayList<FEPLine> lines;
+final public class Highways
+{
+
     final private String FEPHostName;
     final private int FEPPortNum;
     
+    final private ArrayList<FEPLine> lines;
     final public ArrayList<Highway> highways;
-    
-    public Highways(String ldsFileName, String loopsFileName,
-            String highwayMetaFileName, String FEPHostName, int FEPPortNum) {
-        /*
-         lines = loadLines(highwayMetaFileName);
-         System.out.println("SIZE: " + toXML().toCharArray().length);
-         */
-
-        FEPLineLoader ldr = new FEPLineLoader(new File(ldsFileName), new File(loopsFileName));
-        this.lines = (ArrayList<FEPLine>) ldr.getFEPLines();
+
+    public Highways(String highwaysMapFileName, String FEPHostName, int FEPPortNum)
+    {
+        // load FEP Lines
+        lines = loadLines(highwaysMapFileName);
+        // configure and load highways
+        this.highways = configureHighways();
+        
+        // write to FEP host and port number
         this.FEPHostName = FEPHostName;
         this.FEPPortNum = FEPPortNum;
-        this.highways = loadHighways();
-        //writeHighwaysMeta("hard.txt");
-    }
-    
-    private ArrayList<Highway> loadHighways() {
+    }
+
+    private ArrayList<Highway> configureHighways()
+    {
         System.out.println("Loading highways...");
         // The list of highways to return
         ArrayList<Highway> highways = new ArrayList<Highway>();
         
-        Map<Integer, ArrayList<Station>>
-                highwayMap = new HashMap<>();
+        // map of hwy number to its list of stations
+        Map<Integer, ArrayList<Station>> highwayMap = new HashMap<>();
         
+        // iterate through FEPLines and get data to add to the above map
         for (FEPLine line : lines)
         {
+            // grab all stations from the current FEPLine
             ArrayList<Station> lineStations = (ArrayList<Station>) line.stations;
-            for(Station station : lineStations)
+            // iterate through each station in the list of stations
+            for (Station station : lineStations)
             {
                 Integer hwyNum = station.routeNumber;
-
-                if(!highwayMap.containsKey(hwyNum))
+                
+                // if the map does not contain an entry for the highway, create
+                // a new entry (key/value pair) for the highway and instantiate
+                // the empty list of stations
+                if (!highwayMap.containsKey(hwyNum))
                 {
                     ArrayList<Station> stnList = new ArrayList<>();
                     stnList.add(station);
                     highwayMap.put(hwyNum, stnList);
-                }
+                } 
+                // if the map does have an entry for the highway, add the current
+                // station to its list of stations
                 else
                 {
@@ -97,11 +104,14 @@
         }
         
+        // get the set of highway numbers
         Set<Integer> hwyKeys = highwayMap.keySet();
-        for(Integer hwyKey : hwyKeys)
+        // get the highway number and associated stations and create a new hwy
+        // and add the hwy to this.highways
+        for (Integer hwyKey : hwyKeys)
         {
             ArrayList<Station> hwyStations = highwayMap.get(hwyKey);
             Collections.sort(hwyStations);
             System.out.println("Loaded highway " + hwyKey + "...");
-            highways.add(new Highway(hwyKey, 
+            highways.add(new Highway(hwyKey,
                     hwyStations));
         }
@@ -109,9 +119,11 @@
         return highways;
     }
-        /**
-     * Applies specified color to the specified highway stretch. Route number and
-     * direction specify the highway. Postmile and range specify the stretch of
-     * specified highway. Dot color is the color to be applied to the stretch.
-     * 
+
+    /**
+     * Applies specified color to the specified highway stretch. Route number
+     * and direction specify the highway. Postmile and range specify the stretch
+     * of specified highway. Dot color is the color to be applied to the
+     * stretch.
+     *
      * @param routeNumber highway route number
      * @param direction highway direction
@@ -120,22 +132,22 @@
      * @param dotColor the color to be applied to specified highway stretch
      */
-    public void applyColorToHighwayStretch(Integer routeNumber, Station.DIRECTION direction, 
-            Double postmile, Double range, LoopDetector.DOTCOLOR dotColor) {
-        System.out.println("Applying " + dotColor.name() + " dots to highway " 
-                + routeNumber + " " + direction.name() + " at postmile " 
+    public void applyColorToHighwayStretch(Integer routeNumber, Station.DIRECTION direction,
+            Double postmile, Double range, LoopDetector.DOTCOLOR dotColor)
+    {
+        System.out.println("Applying " + dotColor.name() + " dots to highway "
+                + routeNumber + " " + direction.name() + " at postmile "
                 + postmile + " with a range of " + range + " miles...");
-        
+
         // Get the highway by route number
         Highway highway = getHighwayByRouteNumber(routeNumber);
-        
+
         // start value for highway section, and end value for highway section
         // by postmile
         Double startPost;
         Double endPost;
-        
+
         // postmiles increase from s to n and w to e
-        
         // if the direction is south or west
-        if(direction.equals(Station.DIRECTION.SOUTH) || direction.equals(Station.DIRECTION.WEST))
+        if (direction.equals(Station.DIRECTION.SOUTH) || direction.equals(Station.DIRECTION.WEST))
         {
             // add range value to startPost to get
@@ -143,28 +155,27 @@
             startPost = postmile;
             endPost = postmile + range;
-            
+
             // iterate through the stations, if within the specified highway
             // stretch, update the station by direction and apply dot color
-            for(Station station : highway.stations)
-            {
-                if(station.postmile >= startPost && station.postmile <= endPost)
+            for (Station station : highway.stations)
+            {
+                if (station.postmile >= startPost && station.postmile <= endPost)
                 {
                     station.updateByDirection(direction, dotColor);
                 }
             }
-        }
-        // if the direction is north or east 
+        } // if the direction is north or east 
         else
         {
-            //subtract range value from startPost
+            // subtract range value from startPost
             // to get the end postmile value of the highway section
             startPost = postmile;
             endPost = postmile - range;
-            
+
             // iterate through the stations, if within the specified highway
             // section, update the station by direction and apply dot color
-            for(Station station : highway.stations)
-            {
-                if(station.postmile <= startPost && station.postmile >= endPost)
+            for (Station station : highway.stations)
+            {
+                if (station.postmile <= startPost && station.postmile >= endPost)
                 {
                     station.updateByDirection(direction, dotColor);
@@ -174,158 +185,203 @@
         System.out.println("");
     }
-
-    /*
-     private ArrayList<FEPLine> loadLines(String highwayMetaFileName) {
-     ArrayList<FEPLine> lines = new ArrayList<>();
-     try {
-     Scanner sc = new Scanner(new File(highwayMetaFileName));
-     String firstLine = sc.nextLine();
-
-     Scanner linesc = new Scanner(firstLine);
-     int numLines = linesc.nextInt();
-     linesc.close();
-
-     for (int i = 0; i < numLines; i++) {
-     System.out.println("CURR: " + i);
-     lines.add(loadLine(sc));
-     }
-     sc.close();
-
-     } catch (FileNotFoundException ex) {
-     Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex);
-     }
-     return lines;
-     }
-
-     private FEPLine loadLine(Scanner sc) {
-     String line = sc.nextLine();
-     System.out.println(line);
-     Scanner scline = new Scanner(line);
-
-     int lineNum = scline.nextInt();
-     int count = scline.nextInt();
-     int numStations = scline.nextInt();
-     ArrayList<Station> stations = new ArrayList<>();
-     for (int i = 0; i < numStations; i++) {
-     stations.add(loadStation(sc, lineNum));
-     }
-
-     return new FEPLine(lineNum, stations, count);
-     }
-
-     private Station loadStation(Scanner sc, int lineNum) {
-     String line = sc.nextLine();
-     System.out.println(line);
-     Scanner scline = new Scanner(line);
-     int ldsID = scline.nextInt();
-     int drop = scline.nextInt();
-     int fwy = scline.nextInt();
-     DIRECTION dir = DIRECTION.getEnum(scline.next());
-     double postmile = scline.nextDouble();
-     int numLoops = scline.nextInt();
-     String location = getStationLoc(line);
-     ArrayList<LoopDetector> loops = new ArrayList<>();
-     for (int i = 0; i < numLoops; i++) {
-     loops.add(loadLoop(sc));
-     }
-
-     return new Station(lineNum, ldsID, drop, location, loops, fwy, dir, postmile);
-     }
-
-     private LoopDetector loadLoop(Scanner sc) {
-     String line = sc.nextLine();
-     Scanner scline = new Scanner(line);
-
-     int loopID = scline.nextInt();
-     int laneNum = scline.nextInt();
-     String loopLoc = getLoopLoc(line); // NEED GET LOOPLOC
-     scline.close();
-     return new LoopDetector(loopID, loopLoc, laneNum);
-     }
-
-     private String getLoopLoc(String line) {
-     Scanner sc = new Scanner(line);
-     sc.nextInt();
-     sc.nextInt();
+    
+    /**
+     * Loads all FEPLines from the specified highways map file.
+     * 
+     * @param highwaysMapFileName
+     * @return List of FEPLines
+     */
+    private ArrayList<FEPLine> loadLines(String highwaysMapFileName)
+    {
+        ArrayList<FEPLine> lines = new ArrayList<>();
+        try
+        {
+            Scanner sc = new Scanner(new File(highwaysMapFileName));
+            String firstLine = sc.nextLine();
+
+            Scanner linesc = new Scanner(firstLine);
+            int numLines = linesc.nextInt();
+            linesc.close();
+
+            for (int i = 0; i < numLines; i++)
+            {
+                lines.add(loadLine(sc));
+            }
+            sc.close();
+
+        } catch (FileNotFoundException ex)
+        {
+            Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        return lines;
+    }
+    
+    /**
+     * Loads a single FEP Line from the highways map file.
+     * 
+     * @param sc scanner at the current FEPLine line
+     * @return FEPLine
+     */
+    private FEPLine loadLine(Scanner sc)
+    {
+        String line = sc.nextLine();
+        Scanner scline = new Scanner(line);
+
+        int lineNum = scline.nextInt();
+        int count = scline.nextInt();
+        int numStations = scline.nextInt();
+        ArrayList<Station> stations = new ArrayList<>();
+        for (int i = 0; i < numStations; i++)
+        {
+            stations.add(loadStation(sc, lineNum));
+        }
+
+        return new FEPLine(lineNum, stations, count);
+    }
+    
+    /**
+     * Loads a single Station from the highways map file
+     * @param sc scanner at the current station line
+     * @param lineNum the FEPLine number for the station
+     * @return Station
+     */
+    private Station loadStation(Scanner sc, int lineNum)
+    {
+        String line = sc.nextLine();
+        Scanner scline = new Scanner(line);
+        int ldsID = scline.nextInt();
+        int drop = scline.nextInt();
+        int fwy = scline.nextInt();
+        DIRECTION dir = DIRECTION.toDirection(scline.next());
+        double postmile = scline.nextDouble();
+        int numLoops = scline.nextInt();
+        String location = getStationLoc(line);
+        ArrayList<LoopDetector> loops = new ArrayList<>();
+        for (int i = 0; i < numLoops; i++)
+        {
+            loops.add(loadLoop(sc));
+        }
+
+        return new Station(lineNum, ldsID, drop, location, loops, fwy, dir, postmile);
+    }
+    
+    /**
+     * Loads a single loop from the highways map file
+     *
+     * @param sc scanner at the current loop line
+     * @return LoopDetector
+     */
+    private LoopDetector loadLoop(Scanner sc)
+    {
+        String line = sc.nextLine();
+        Scanner scline = new Scanner(line);
+
+        int loopID = scline.nextInt();
+        int laneNum = scline.nextInt();
+        String loopLoc = getLoopLoc(line); // NEED GET LOOPLOC
+        scline.close();
+        return new LoopDetector(loopID, loopLoc, laneNum);
+    }
+
+    /**
+     * Scans the LoopDetector line and grabs the String location from the line.
+     * 
+     * @param line the line containing the location
+     * @return A String loop location.
+     */
+    private String getLoopLoc(String line)
+    {
+        Scanner sc = new Scanner(line);
+        sc.nextInt();
+        sc.nextInt();
 
      // GRABS FROM CURRENT TO END OF LINE
-         
-     sc.useDelimiter("\\z");
-     String loc = sc.next().trim();
-     sc.close();
-     return loc;
-     }
-
-     // Returns the loction given the whole line from the lookup file
-     private String getStationLoc(String line) {
-     Scanner scline = new Scanner(line);
-     scline.nextInt();
-     scline.nextInt();
-     scline.nextInt();
-     scline.next();
-     scline.nextDouble();
-     scline.nextInt();
-
-     // GRABS FROM CURRENT TO END OF LINE
-     scline.useDelimiter("\\z");
-     String loc = scline.next().trim();
-     scline.close();
-     return loc;
-     }
-     */
-
-    public void writeToFEP() throws SimulationException {
-        try {
-            Socket sock = new Socket(FEPHostName /*"192.168.251.130"*/, 8080);
+        sc.useDelimiter("\\z");
+        String loc = sc.next().trim();
+        sc.close();
+        return loc;
+    }
+
+    /**
+     * Scans the Station line and grabs the String location from the line.
+     * 
+     * @param line the line containing the location
+     * @return A String station location.
+     */
+    private String getStationLoc(String line)
+    {
+        Scanner scline = new Scanner(line);
+        scline.nextInt();
+        scline.nextInt();
+        scline.nextInt();
+        scline.next();
+        scline.nextDouble();
+        scline.nextInt();
+
+        // GRABS FROM CURRENT TO END OF LINE
+        scline.useDelimiter("\\z");
+        String loc = scline.next().trim();
+        scline.close();
+        return loc;
+    }
+    
+    /** 
+     * Creates a socket client that writes the Highways data to the FEP Simulator.
+     * 
+     * @throws SimulationException 
+     */
+    public void writeToFEP() throws SimulationException
+    {
+        try
+        {
+            // Create the socket to the FEP Simulator
+            Socket sock = new Socket(FEPHostName, FEPPortNum);
             PrintWriter out = new PrintWriter(sock.getOutputStream(), true);
+            
+            // Print the number of bytes the highways data message contains
             System.out.println("BYTES: " + this.toXML().toCharArray().length + 1);
+            
+            // Write the highways data over the socket
             out.println(this.toXML());
+            
+            // close the socket
             sock.close();
-        } catch (IOException ex) {
+        } catch (IOException ex)
+        {
             Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex);
             System.out.println("Highway Model failed writing to FEPSim.");
             throw new SimulationException(SimulationException.BINDING);
         }
-        updateSequences();
-    }
-
-    // CHECK: DO WE EVEN NEED TO DO THIS?
-    private void updateSequences() {
-        for (FEPLine line : lines) {
-            line.updateSequences();
-        }
-    }
-
-    /**
-     * Returns the network metadata in condensed form. This is just a quick
-     * script function to make a proper highway metadata configuration file, so
-     * that we can read the network faster.
+    }
+
+    /**
+     * Returns the highways metadata in condensed form. This function took the 
+     * highways model and wrote it into condensed form. It is also useful for
+     * testing.
      *
-     * @return Network metadata
-     */
-    public void writeHighwaysMeta(String fileName) {
-
-        try {
-            FileWriter fw = new FileWriter(new File(fileName));
+     * @return the highways meta data string
+     */
+    public String getHighwaysMeta()
+    {
             StringBuilder build = new StringBuilder();
             build.append(lines.size());
             build.append("\n");
-            System.out.println(lines.size());
-            fw.write(build.toString());
-            int count = 1;
-            for (FEPLine line : lines) {
-                System.out.println("Writing num: " + count);
-                count++;
-                fw.write(line.getLineMeta());
-
-            }
-        } catch (IOException ex) {
-            Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex);
-        }
-    }
-
-    public String toXML() {
+            for (FEPLine line : lines)
+            {
+                build.append(line.getLineMeta());
+            }
+            return build.toString();
+    }
+
+    /**
+     * Returns the Highways model data in XML format.
+     * 
+     * @return highways data in XML format
+     */
+    public String toXML()
+    {
         String xml = null;
-        try {
+        try
+        {
             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
             DocumentBuilder builder = factory.newDocumentBuilder();
@@ -335,5 +391,6 @@
             theDoc.appendChild(networkElement);
 
-            for (FEPLine line : lines) {
+            for (FEPLine line : lines)
+            {
                 line.toXML(networkElement);
             }
@@ -349,5 +406,6 @@
             xml = out.toString();
             out.close();
-        } catch (Exception ex) {
+        } catch (Exception ex)
+        {
             Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex);
         }
@@ -356,9 +414,16 @@
     }
 
-    public Highway getHighwayByRouteNumber(Integer routeNum) {
+    /**
+     * Returns a highway by given highway number.
+     * 
+     * @param routeNum
+     * @return Highway with specified route number
+     */
+    public Highway getHighwayByRouteNumber(Integer routeNum)
+    {
         Highway returnHwy = null;
-        for(Highway hwy : highways)
-        {
-            if(hwy.routeNumber.equals(routeNum))
+        for (Highway hwy : highways)
+        {
+            if (hwy.routeNumber.equals(routeNum))
             {
                 returnHwy = hwy;
@@ -369,5 +434,9 @@
     }
 
-    private static enum XML_TAGS {
+    /**
+     * XML tags used in writeToXML()
+     */
+    private static enum XML_TAGS
+    {
 
         NETWORK("Network");
@@ -375,5 +444,6 @@
         String tag;
 
-        private XML_TAGS(String n) {
+        private XML_TAGS(String n)
+        {
             tag = n;
         }
Index: trunk/src/atmsdriver/model/LoopDetector.java
===================================================================
--- trunk/src/atmsdriver/model/LoopDetector.java	(revision 180)
+++ trunk/src/atmsdriver/model/LoopDetector.java	(revision 184)
@@ -6,5 +6,6 @@
 import org.w3c.dom.Element;
 
-/** A LoopDetector represents a single detector for a single lane in a network.
+/** 
+ *  A LoopDetector represents a single detector for a single lane in a network.
  * 
  *  A LoopDetector contains static meta data, and three dynamic attributes: vol,
@@ -26,4 +27,11 @@
     private int spd;
     
+    /**
+     * Constructs a LoopDetector from loopID, loopLocation, and laneNum
+     * 
+     * @param loopID
+     * @param loopLocation
+     * @param laneNum 
+     */
     public LoopDetector(int loopID, String loopLocation, int laneNum)
     {
@@ -39,4 +47,7 @@
     }
     
+    /**
+     * XML tags used for toXML() method.
+     */
     private static enum XML_TAGS
     {
@@ -89,5 +100,10 @@
         this.spd = spd;
     }
-    
+
+    /**
+     * Returns the LoopDetector data in XMLFormat
+     * 
+     * @param currElem The current XML <LoopDetector> element
+     */
     public void toXML(Element currElem)
     {
