import java.util.*;

public class Computer
{
    public Computer (boolean debug)
    {
        _accumulator = 0;
        _debug = debug;
    }

    public int executeUntilInfiniteLoop (Vector<OpCode> instructions)
    {
        int index = 0;
        OpCode op = instructions.elementAt(index);

        _accumulator = 0;

        while (!op.visited())
        {
            switch (op.type())
            {
                case OpCode.ACCUMULATOR:
                {
                    _accumulator += ((Accumulator) op).getValue();
                }
                break;
                case OpCode.JUMP:
                {
                    index += ((Jump) op).getStep();
                }
                break;
                case OpCode.NOOP:
                default:
                {
                    index++;
                }
                break;
            }

            op.visited();
        }

        return _accumulator;
    }

    private int _accumulator;
    private boolean _debug;
}
@@ -347,32 +347,111 @@
 ed())%0A        %7B%0A
+            if (_debug)%0A                System.out.println(%22Executing: %22+op);%0A%0A
             swit
@@ -562,22 +562,18 @@
     
-_accumulator +
+int value 
 = ((
@@ -605,100 +605,439 @@
 ();%0A
-                %7D%0A                break;%0A                case OpCode.JUMP:%0A                %7B
+%0A                    if (_debug)%0A                        System.out.println(%22Adding %22+value+%22 to accumulator %22+_accumulator);%0A%0A                    _accumulator += value;%0A                %7D%0A                break;%0A                case OpCode.JUMP:%0A                %7B%0A                    int value = ((Jump) op).getStep();%0A%0A                    if (_debug)%0A                        System.out.println(%22Adding %22+value+%22 to index %22+index);%0A
 %0A   
@@ -1227,16 +1227,18 @@
     
-index++;
+// no op!!
 %0A   
@@ -1302,27 +1302,96 @@
         
-op.visited(
+index++;%0A%0A            op.visit();%0A%0A            op = instructions.elementAt(index
 );%0A     

Update Computer.java