import java.util.*;

public class TicketCheck
{
    public static final String DATA_FILE = "data.txt";

    public static final String FIELD = "departure";

    public static void main (String[] args)
    {
        boolean verify = false;
        boolean debug = false;

        for (int i = 0; i < args.length; i++)
        {
            if ("-help".equals(args[i]))
            {
                System.out.println("Usage: [-debug] [-verify] [-help]");
                System.exit(0);
            }

            if ("-debug".equals(args[i]))
                debug = true;

            if ("-verify".equals(args[i]))
                verify = true;
        }

        if (verify)
        {
            Verifier v = new Verifier(debug);

            if (v.verify())
                System.out.println("Verified ok.");
            else
                System.out.println("Verify failed!");

            System.exit(0);
        }

        Vector<Category> cats = Util.loadCategories(DATA_FILE, debug);
        Vector<Ticket> ticks = Util.loadTickets(DATA_FILE, debug);

        if (debug)
        {
            for (int i = 0; i < cats.size(); i++)
                System.out.println(cats.elementAt(i));

            for (int j = 0; j < ticks.size(); j++)
                System.out.println(ticks.elementAt(j));
        }
    }
}
@@ -1054,24 +1054,94 @@
 ILE, debug);
+%0A        Vector%3CTicket%3E validTickets = Util.validTickets(cats, ticks);
 %0A%0A        if
@@ -1184,21 +1184,29 @@
 int 
-i
+j
  = 0; 
-i %3C ca
+j %3C validTicke
 ts.s
@@ -1212,17 +1212,17 @@
 size(); 
-i
+j
 ++)%0A    
@@ -1252,18 +1252,26 @@
 println(
-ca
+validTicke
 ts.eleme
@@ -1279,22 +1279,21 @@
 tAt(
-i
+j
 ));%0A
-%0A
         
     
@@ -1292,115 +1292,87 @@
     
+%7D%0A%0A
     
-for (int j = 0; j %3C ticks.size(); j++)%0A                System.out.println(ticks.elementAt(j)
+    Vector%3CCategory%3E results = Util.order(validTickets, cats
 );%0A
+%0A
         
 %7D%0A  
@@ -1367,17 +1367,16 @@
         
-%7D
 %0A    %7D%0A%7D

Update TicketCheck.java