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

public class Verifier
{
    public static final String EXAMPLE1_FILE = "example1.txt";
    public static final int TOTAL_ORE_1 = 31;
    public static final String EXAMPLE2_FILE = "example2.txt";
    public static final int TOTAL_ORE_2 = 165;
    public static final String EXAMPLE3_FILE = "example3.txt";
    public static final int TOTAL_ORE_3 = 13312;
    public static final String EXAMPLE4_FILE = "example4.txt";
    public static final int TOTAL_ORE_4 = 180697;
    public static final String EXAMPLE5_FILE = "example5.txt";
    public static final int TOTAL_ORE_5 = 2210736;

    public Verifier (boolean debug)
    {
        _debug = debug;

        _theParser = new Parser(debug);
    }

    public final boolean verify ()
    {
        Vector<Reaction> reactions = _theParser.loadData(EXAMPLE1_FILE);

        //if (_debug)
        {
            Enumeration<Reaction> iter = reactions.elements();

            while (iter.hasMoreElements())
                System.out.println(iter.nextElement());
        }

        HashMap<Chemical, Integer> inventory = new HashMap<Chemical, Integer>();
        Reaction fuel = findReaction(Chemical.FUEL, reactions);

        if (fuel != null)
        {
            boolean completed = false;
            int fuelNeeded = fuel.chemicalCreated().getAmount();
        }
        else
            System.out.println("Error! No fuel required?!");

        return false;
    }

    private Reaction findReaction (String name, Vector<Reaction> reactions)
    {
        Enumeration<Reaction> iter = reactions.elements();

        while (iter.hasMoreElements())
        {
            Reaction r = iter.nextElement();

            if (r.chemicalCreated().equals(name))
                return r;
        }

        return null;
    }

    private boolean _debug;
    private Parser _theParser;
}
@@ -725,24 +725,177 @@
 ug);%0A    %7D%0A%0A
+    /*%0A     * 10 ORE =%3E 10 A%0A     * 1 ORE =%3E 1 B%0A     * 7 A, 1 B =%3E 1 C%0A     * 7 A, 1 C =%3E 1 D%0A     * 7 A, 1 D =%3E 1 E%0A     * 7 A, 1 E =%3E 1 FUEL%0A     */%0A%0A
     public f
@@ -1347,16 +1347,77 @@
 ctions);
+%0A        Vector%3CReactant%3E inventory = new Vector%3CReactant%3E();
 %0A%0A      
@@ -1546,24 +1546,301 @@
 etAmount();%0A
+            Vector%3CReactant%3E reactants = fuel.getReactants();%0A%0A            /*%0A             * Go through each reactant and try to create the%0A             * required amount, storing excess in the inventory.%0A             * So check the inventory first, of course.%0A             */%0A
         %7D%0A  
@@ -1911,16 +1911,24 @@
 ed?!%22);%0A
+        
 %0A       
@@ -2222,16 +2222,40 @@
 eated().
+getChemical().getName().
 equals(n
@@ -2317,32 +2317,808 @@
 rn null;%0A    %7D%0A%0A
+    private int takeFromInventory (Reactant name, Vector%3CReactant%3E inventory, int amountNeeded)%0A    %7B%0A        Enumeration%3CReactant%3E iter = inventory.elements();%0A        int amount = -1;%0A%0A        while (iter.hasMoreElements())%0A        %7B%0A            Reactant r = iter.nextElement();%0A%0A            if (r.getChemical().equals(name.getChemical()))%0A            %7B%0A                int amountFound = r.getAmount();%0A%0A                if (amountFound %3E 0)%0A                %7B%0A                    if (amountFound %3E= amountNeeded)%0A                        amount = amountNeeded;%0A                    else%0A                        amount = amountNeeded - amountFound;%0A%0A                    r.setAmount(amountFound - amount);%0A                %7D%0A            %7D%0A        %7D%0A%0A        return amount;%0A    %7D%0A%0A
     private bool

Update Verifier.java