public class Level
{
    public static final int CENTRE_HEIGHT = 3;  // TODO only makes sense for 5x5 so need to fix this!!
    public static final int CENTRE_WIDTH = 3;

    public Level (int height, int width, int level, boolean debug)
    {
        _level = level;
        _height = height;
        _width = width;
        _debug = debug;

        _theWorld = new Tile[_height][_width];

        for (int i = 0; i < _height; i++)
        {
            for (int j = 0; j < _width; j++)
            {
                _theWorld[i][j] = new Tile(TileId.EMPTY_SPACE);
            }
        }

        _theWorld[CENTRE_HEIGHT][CENTRE_WIDTH] = new Tile(TileId.NESTED_GRID);
    }

    public Level (Tile[][] theWorld, int level, boolean debug)
    {
        _theWorld = theWorld;
        _height = _theWorld.length;
        _width = _theWorld[0].length;
        _level = level;
        _debug = debug;
    }

    public final int getLevel ()
    {
        return _level;
    }

    @Override
    public String toString ()
    {
        String str = "";

        for (int i = 0; i < _height; i++)
        {
            for (int j = 0; j < _width; j++)
            {
                if ((i == CENTRE_HEIGHT) && (j == CENTRE_WIDTH))
                    str += TileId.NESTED_GRID;
                else
                    str += _theWorld[i][j];
            }
            
            str += "\n";
        }

        return str;
    }

    @Override
    public boolean equals (Object obj)
    {
        if (obj == null)
            return false;

        if (this == obj)
            return true;
        
        if (getClass() == obj.getClass())
        {
            Level temp = (Level) obj;

            if ((temp._height == _height) && (temp._width == _width))
            {
                for (int i = 0; i < _height; i++)
                {
                    for (int j = 0; j < _width; j++)
                    {
                        if (temp._theWorld[i][j].type() != _theWorld[i][j].type())
                            return false;
                    }
                }

                return true;
            }
        }

        return false;
    }

    protected Level (Level theGrid)
    {
        _height = theGrid._height;
        _width = theGrid._width;
        _debug = theGrid._debug;

        _theWorld = new Tile[_height][_width];

        for (int i = 0; i < _height; i++)
        {
            for (int j = 0; j < _width; j++)
            {
                _theWorld[i][j] = new Tile(theGrid._theWorld[i][j].type());
            }
        }
    }

    private Tile[][] _theWorld;
    private int _level;
    private int _height;
    private int _width;
    private boolean _debug;
}
@@ -959,32 +959,307 @@
  _level;%0A    %7D%0A%0A
+    public boolean containsBug (int i, int j) throws IndexOutOfBoundsException%0A    %7B%0A        if (_debug)%0A            System.out.println(%22Checking %3C %22+i+%22, %22+j+%22 %3E%22);%0A%0A        if (_theWorld%5Bi%5D%5Bj%5D.isBug())%0A            return true;%0A        else%0A            return false;%0A    %7D%0A%0A
     @Override%0A  

Update Level.java