import java.util.*;

public class XMAS
{
    public XMAS (boolean debug)
    {
        _debug = debug;
    }

    public Vector<Integer> validate (Vector<Integer> input, int preamble)
    {
        Vector<Integer> invalid = new Vector<Integer>();
        int index = 0;

        for (int i = preamble; i < input.size(); i++)
        {
            if (!sums(elementAt(i), input, index, preamble))
                invalid.add(elementAt(i));
            
            index++;
        }

        return invalid;
    }

    private boolean sums (int total, Vector<Integer> input, int start, int preanble)
    {
        for (int j = start; j < (start + preamble -1); j++)
        {
            if (input.elementAt(index) + input.elementAt(index +1) == total)
            {
                return true;
            }
        }

        if (_debug)
            System.out.println(total+" is not the sum of two entries.");
            
        return false;
    }

    private boolean _debug;
}
@@ -350,16 +350,22 @@
  (!sums(
+input.
 elementA
@@ -423,16 +423,22 @@
 lid.add(
+input.
 elementA
@@ -599,17 +599,17 @@
 int prea
-n
+m
 ble)%0A   
@@ -713,21 +713,21 @@
 ementAt(
-index
+start
 ) + inpu
@@ -738,21 +738,21 @@
 ementAt(
-index
+start
  +1) == 
@@ -919,28 +919,16 @@
 ies.%22);%0A
-            
 %0A       

Update XMAS.java