import java.util.*;

/**
 * Take an image from the camera and turn it into a map
 * which can be used to move around.
 */

public class Map
{
    public Map (Image img, boolean debug)
    {
        _theMap = new Vector<Cell>();
        _maxX = 0;
        _maxY = 0;
        _debug = debug;

        createMapFromImage(img.scannedLines());
    }

    public Coordinate findStartingPoint ()
    {
        Enumeration<Cell> iter = _theMap.elements();

        while (iter.hasMoreElements())
        {
            Cell cur = iter.nextElement();

            if (cur.getContents().equals(CellId.ROBOT_FACING_UP))
                return cur.position();
        }

        return null;
    }

    public boolean isScaffold (Coordinate coord)
    {
        Cell temp = new Cell(coord);
        int index = _theMap.indexOf(temp);

        temp = _theMap.get(index);

        return (temp.getContents().equals(CellId.SCAFFOLDING));
    }

    @Override
    public String toString ()
    {
        Enumeration<Cell> iter = _theMap.elements();
        int index = 1;
        String str = "Map dimensions < "+_maxX+", "+_maxY+" >\n";

        while (iter.hasMoreElements())
        {
            str += iter.nextElement().getContents();

            if (index++ == _maxX)
            {
                str += "\n";

                index = 1;
            }
        }

        return str;
    }

    private void createMapFromImage (String[] lines)
    {
        int lineLength = lines[0].length(); // all lines are the same length

        _maxY = lines.length;
        _maxX = lineLength;

        for (int y = 0; y < lines.length -1; y++)
        {
            for (int x = 0; x < lineLength; x++)
            {
                Cell theCell = new Cell(new Coordinate(x, y), String.valueOf(lines[y].charAt(x)), _debug);

                if (_debug)
                    System.out.println(theCell);

                _theMap.add(theCell);
            }
        }
    }

    private Vector<Cell> _theMap;
    private int _maxX;
    private int _maxY;
    private boolean _debug;
}
@@ -255,24 +255,54 @@
  _maxY = 0;%0A
+        _originalImage = img;%0A
         _deb
@@ -313,16 +313,16 @@
  debug;%0A
-
 %0A       
@@ -361,32 +361,289 @@
 ines());%0A    %7D%0A%0A
+    public Map (Map toCopy)%0A    %7B%0A        _theMap = new Vector%3CCell%3E();%0A        _maxX = 0;%0A        _maxY = 0;%0A        _originalImage = toCopy._originalImage;%0A        _debug = toCopy._debug;%0A%0A        createMapFromImage(_originalImage.scannedLines());%0A    %7D%0A%0A
     public Coord
@@ -1205,24 +1205,248 @@
 G));%0A    %7D%0A%0A
+    public void changeElement (Coordinate coord, String type)%0A    %7B%0A        Cell temp = new Cell(coord);%0A        int index = _theMap.indexOf(temp);%0A%0A        temp = _theMap.get(index);%0A%0A        temp.setContents(type);%0A    %7D%0A%0A
     @Overrid
@@ -2517,16 +2517,16 @@
  _maxX;%0A
-
     priv
@@ -2540,16 +2540,50 @@
  _maxY;%0A
+    private Image _originalImage;%0A
     priv

Update Map.java