import java.util.*;

public class Ship
{
    public Ship (boolean debug)
    {
        _facing = Direction.EAST;
        _position = new Coordinate(0, 0);
        _debug = debug;
    }

    public final char getFacing ()
    {
        return _facing;
    }

    public final Coordinate getPosition ()
    {
        return _position;
    }

    public final int getManhattanDistance ()
    {
        return Math.abs(_position.getX()) + Math.abs(_position.getY());
    }

    public final void move (Vector<Command> commands)
    {
        Enumeration<Command> iter = commands.elements();

        while (iter.hasMoreElements())
        {
            Command c = iter.nextElement();

            if (_debug)
            {
                System.out.println("Ship position: "+_position);
                System.out.println("Ship executing "+c);
            }

            // if FORWARD then move in the direction defined by our facing

            if (c.action() == Action.FORWARD)
                c = new Command(_facing, c.quantity());

            switch (c.action())
            {
                case Action.EAST:
                {
                    _position = new Coordinate(_position.getX() + c.quantity(), _position.getY());
                }
                break;
                case Action.WEST:
                {
                    _position = new Coordinate(_position.getX() - c.quantity(), _position.getY());
                }
                break;
                case Action.NORTH:
                {
                    _position = new Coordinate(_position.getX(), _position.getY() + c.quantity());
                }
                break;
                case Action.SOUTH:
                {
                    _position = new Coordinate(_position.getX(), _position.getY() - c.quantity());
                }
                break;
                case Action.LEFT:
                case Action.RIGHT:
                {
                    _facing = Util.getNextFacing(_facing, c);
                }
                break;
                default:
                {
                    System.out.println("Unexpected command: "+c);
                }
                break;
            }
        }
    }

    @Override
    public String toString ()
    {
        return "Ship facing "+_facing+" and position "+_position;
    }

    private char _facing;
    private Coordinate _position;
    private boolean _debug;
}
@@ -148,16 +148,59 @@
 (0, 0);%0A
+        _waypoint = new Coordinate(10, 1);%0A
         
@@ -861,223 +861,426 @@
 ln(%22
-Ship executing %22+c);%0A            %7D%0A%0A            // if FORWARD then move in the direction defined by our facing%0A%0A            if (c.action() == Action.FORWARD)%0A                c = new Command(_facing, c.quantity()
+Waypoint position: %22+_waypoint);%0A                System.out.println(%22Ship executing %22+c);%0A            %7D%0A%0A            switch (c.action())%0A            %7B%0A                case Action.FORWARD:%0A                %7B%0A                    int x = _position.getX() + (_waypoint.getX() * distOrDeg);%0A                    int y = position.getY() + (_waypoint.getY() * distOrDeg);%0A%0A                    _position = new Coordinate(x, y
 );%0A
-%0A
     
@@ -1287,35 +1287,21 @@
         
-switch (c.action())
+    %7D
 %0A       
@@ -1297,33 +1297,42 @@
   %7D%0A            
-%7B
+    break;
 %0A               
@@ -2636,24 +2636,58 @@
  _position;%0A
+    private Coordinate _waypoint;%0A
     private 

Update Ship.java