Index: trunk/src/scriptbuilder/structures/MyScriptHandler.java
===================================================================
--- trunk/src/scriptbuilder/structures/MyScriptHandler.java	(revision 37)
+++ trunk/src/scriptbuilder/structures/MyScriptHandler.java	(revision 38)
@@ -244,4 +244,5 @@
         incidentMap = new TreeMap<Integer, ScriptIncident>();
         eventMap = new TreeMap<ELEMENT, I_ScriptEvent>();
+        unitMap = new TreeMap<String, Unit>();
         pcData = new TreeMap<ELEMENT, String>();
         docPosition = new Stack<ELEMENT>();
@@ -257,4 +258,14 @@
         return new Vector<ScriptIncident>(incidentMap.values());
     }
+    
+    /**
+     * Get the list of units that have been parsed from the script file.
+     *
+     * @returns Vector of Unit objects.
+     */
+    public Vector<Unit> getUnits()
+    {
+        return new Vector<Unit>(unitMap.values());
+    }
 
     /**
@@ -265,8 +276,5 @@
     {
         //System.out.println("STUB: Start the document");
-        for (ELEMENT e : ELEMENT.values())
-        {
-            pcData.put(e, null);
-        }
+        
     }
 
@@ -601,5 +609,4 @@
     public void endElement(String uri, String localName, String qName)
     {
-
         currentElement = docPosition.pop();
         I_ScriptEvent newEvent = null;
@@ -791,5 +798,5 @@
             }
 
-            else if (qName.equals(ELEMENT.INCIDENT.tag))
+            else if (currentElement == ELEMENT.INCIDENT)
             {
                 currentIncName = parsedValue.toString();
@@ -805,5 +812,5 @@
 
             }
-            else if (qName.equals(ELEMENT.NEW_UNIT))
+            else if (currentElement == ELEMENT.NEW_UNIT)
             {
                 if (unitMap.get(NewUnitNum) == null)
@@ -879,4 +886,5 @@
                         unit.Timer = pcData.remove(ELEMENT.TIMER);
                     }
+                    unitMap.put(NewUnitNum, unit);
                 }
             }
