import java.util.*;

public class Total
{
    public Total (Vector<Integer> list, boolean debug)
    {
        _numbers = list;
        _debug = debug;

        if (_debug)
            System.out.println("Size of numbers: "+_numbers.size());
    }

    public Integer[] sum (int total)
    {
        if (_debug)
            System.out.println("Checking for "+total);

        Integer[] toReturn = new Integer[2];
        boolean found = false;

        for (int i = 0; (i < _numbers.size()) && !found; i++)
        {
            toReturn[0] = _numbers.elementAt(i);

            if (_debug)
                System.out.println("First number: "+toReturn[0]);

            for (int j = i+1; (j < _numbers.size()) && !found; j++)
            {
                if (_debug)
                    System.out.println("Checking "+toReturn[0]+" and "+_numbers.elementAt(j));

                if (toReturn[0] + _numbers.elementAt(j) == total)
                {
                    toReturn[1] = _numbers.elementAt(j);

                    found = true;
                }
            }
        }

        if (found)
            return toReturn;
        else
            return null;
    }

    private Vector<Integer> _numbers;
    private boolean _debug;
}
@@ -406,9 +406,9 @@
 ger%5B
-2
+3
 %5D;%0A 
@@ -745,36 +745,288 @@
             
-if (_debug)%0A
+toReturn%5B1%5D = _numbers.elementAt(j);%0A%0A                if (_debug)%0A                    System.out.println(%22Second number: %22+toReturn%5B1%5D);%0A%0A                for (int k = j+1; (k %3C _numbers.size()) && !found; k++)%0A                %7B%0A                    if (_debug)%0A    
             
@@ -1077,16 +1077,36 @@
 urn%5B0%5D+%22
+ and %22+toReturn%5B1%5D+%22
  and %22+_
@@ -1127,14 +1127,18 @@
 tAt(
-j
+k
 ));%0A%0A
+    
     
@@ -1166,16 +1166,30 @@
 urn%5B0%5D +
+ toReturn%5B1%5D +
  _number
@@ -1200,17 +1200,17 @@
 ementAt(
-j
+k
 ) == tot
@@ -1221,34 +1221,42 @@
                 
+   
+ 
 %7B%0A
+    
                 
@@ -1260,33 +1260,33 @@
        toReturn%5B
-1
+2
 %5D = _numbers.ele
@@ -1284,33 +1284,33 @@
 mbers.elementAt(
-j
+k
 );%0A%0A            
@@ -1317,16 +1317,20 @@
         
+ 
+   
 found = 
@@ -1335,16 +1335,38 @@
 = true;%0A
+                    %7D%0A
         

Update Total.java