import java.util.*;
import java.io.*;

public class Timetable
{
    public static String SEPARATOR = ",";

    public Timetable (String fileName, boolean debug)
    {
        _buses = new Vector<Bus>();
        _debug = debug;

        loadData(fileName);
    }

    private void loadData (String inputFile)
    {
        /*
         * Open the data file and read it in.
         */

        BufferedReader reader = null;

        try
        {
            reader = new BufferedReader(new FileReader(inputFile));
            String line = null;

            while ((line = reader.readLine()) != null)
            {
                String[] busData = line.split(SEPARATOR);

                for (int i = 0; i < busData.length; i++)
                {
                    Bus bs = new Bus(Integer.parseInt(busData[i]));

                    if (_debug)
                        System.out.println("Loaded "+bs);

                    _buses.add(bs);
                }
            }
        }
        catch (Throwable ex)
        {
            ex.printStackTrace();
        }
        finally
        {
            try
            {
                reader.close();
            }
            catch (Throwable ex)
            {
            }
        }
    }

    private Vector<Bus> _buses;
    private boolean _debug;
}
@@ -98,16 +98,63 @@
 R = %22,%22;
+%0A    public static String OUT_OF_SERVICE = %22x%22;
 %0A%0A    pu
@@ -199,32 +199,64 @@
 an debug)%0A    %7B%0A
+        _earliestDeparture = 0;%0A
         _buses =
@@ -813,32 +813,300 @@
               %7B%0A
+                    if (OUT_OF_SERVICE.equals(busData%5Bi%5D))%0A                    %7B%0A                        if (_debug)%0A                            System.out.println(%22Loaded out of service bus.%22);%0A                    %7D%0A                    else%0A                    %7B%0A    
                 
@@ -1170,32 +1170,36 @@
                 
+    
 if (_debug)%0A    
@@ -1210,32 +1210,36 @@
                 
+   
+ 
 System.out.print
@@ -1273,24 +1273,28 @@
             
+    
 _buses.add(b
@@ -1297,16 +1297,38 @@
 dd(bs);%0A
+                    %7D%0A
         
@@ -1616,32 +1616,68 @@
        %7D%0A    %7D%0A%0A
+    private int _earliestDeparture;%0A
     private Vect

Update Timetable.java