public class DroidMovement
{
    public static final int NORTH = 1;
    public static final int SOUTH = 2;
    public static final int WEST = 3;
    public static final int EAST = 4;

    public static final int backup (int direction)
    {
        switch (direction)
        {
            case NORTH:
                return SOUTH;
            case SOUTH:
                return NORTH;
            case WEST:
                return EAST;
            case EAST:
                return WEST;
            default:
            {
                System.out.println("Error - invalid direction: "+direction);

                return 0;
            }
        }
    }

    public static final String toString (int direction)
    {
        switch (direction)
        {
            case NORTH:
                return "NORTH";
            case SOUTH:
                return "SOUTH";
            case WEST:
                return "WEST";
            case EAST:
                return "EAST";
            default:
                return "UNKNOWN";
        }
    }

    public static final String toString (String direction)
    {
        switch (direction)
        {
            case "1":
                return "NORTH";
            case "2":
                return "SOUTH";
            case "3":
                return "WEST";
            case "4":
                return "EAST";
            default:
                return "UNKNOWN";
        }
    }

    private DroidMovement ()  // prevent instantiation
    {
    }
}
@@ -201,19 +201,26 @@
 c final 
-int
+Coordinate
  backup 
@@ -225,32 +225,50 @@
 p (int direction
+, Coordinate coord
 )%0A    %7B%0A        
@@ -343,21 +343,61 @@
  return 
-SOUTH
+new Coordinate(coord.getX(), coord.getY() +1)
 ;%0A      
@@ -437,21 +437,61 @@
  return 
-NORTH
+new Coordinate(coord.getX(), coord.getY() -1)
 ;%0A      
@@ -530,20 +530,61 @@
  return 
-EAST
+new Coordinate(coord.getX() -1, coord.getY())
 ;%0A      
@@ -623,20 +623,61 @@
  return 
-WEST
+new Coordinate(coord.getX() +1, coord.getY())
 ;%0A      
@@ -810,9 +810,13 @@
 urn 
-0
+coord
 ;%0A  

Update DroidMovement.java