import java.util.*;

public class Layer
{
    public Layer (int layer, int height, int width, boolean debug)
    {
        _level = new HashSet<ThreeDPoint>();
        _layer = layer;
        _height = height;
        _width = width;
        _debug = debug;
    }

    public final int getLevel ()
    {
        return _layer;
    }

    public final void addBug (ThreeDPoint location)
    {
        _level.add(location);
    }

    public final HashSet<ThreeDPoint> getBugs ()
    {
        return _level;
    }

    public final long bugCount ()
    {
        return _level.size();
    }

    @Override
    public String toString ()
    {
        String str = "";
        
        for (int i = 0; i < _height; i++)
        {/*
            for (int j = 0; j < _width; j++)
            {
                if ((i == GridData.CENTRE_Y) && (j == GridData.CENTRE_X))
                    str += CubeId.NESTED_GRID;
                else
                {
                    ThreeDPoint point = new ThreeDPoint(i, j, _layer);

                    if (_level.contains(point))
                        str += CubeId.BUG;
                    else
                        str += CubeId.EMPTY_SPACE;
                }
            }
*/
            str += "\n";
        }

        return str;
    }

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

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

            if (temp._level.size() == _level.size())
            {
                Iterator<ThreeDPoint> iter = _level.iterator();

                while (iter.hasNext())
                {
                    if (!temp._level.contains(iter.next()))
                        return false;
                }

                return true;
            }
        }

        return false;
    }

    private HashSet<ThreeDPoint> _level;
    private int _layer;
    private int _height;
    private int _width;
    private boolean _debug;
}
@@ -121,42 +121,39 @@
    _
-level
+cubes
  = new 
-HashSet%3CThreeDPoint%3E()
+char%5Bheight%5D%5Bwidth%5D
 ;%0A  
@@ -187,298 +187,212 @@
    _
-height = height;%0A        _width = width;%0A        _debug = debug;%0A    %7D%0A%0A    public final int getLevel (
+debug = debug;%0A%0A        for (int i = 0; i %3C _cubes.length; i++
 )%0A    
-%7B%0A
     
+%7B%0A
     
-return _layer;%0A    %7D%0A%0A    public final void addBug (ThreeDPoint location)%0A    %7B%0A        _level.add(location);%0A
+        for (int i = 0; j %3C _cubes%5B0%5D.length; j++)%0A            %7B%0A        
     
-%7D%0A%0A
     
-public final HashSet%3CThreeDPoint%3E getBugs ()%0A
+_cubes%5Bi%5D%5Bj%5D = CubeId.INACTIVE;%0A        
     
-%7B
+%7D
 %0A   
@@ -400,22 +400,9 @@
     
-return _level;
+%7D
 %0A   
@@ -426,21 +426,20 @@
 nal 
-long bugCount
+int getLevel
  ()%0A
@@ -461,27 +461,20 @@
 eturn _l
-evel.size()
+ayer
 ;%0A    %7D%0A
@@ -587,22 +587,28 @@
 0; i %3C _
-height
+cubes.length
 ; i++)%0A 
@@ -619,10 +619,8 @@
    %7B
-/*
 %0A   
@@ -653,320 +653,44 @@
  %3C _
-width; j++)%0A            %7B%0A                if ((i == GridData.CENTRE_Y) && (j == GridData.CENTRE_X))%0A                    str += CubeId.NESTED_GRID;%0A                else%0A                %7B%0A                    ThreeDPoint point = new ThreeDPoint(i, j, _layer);%0A%0A                    if (_level.contains(point))%0A      
+cubes%5B0%5D.length; j++)%0A            %7B%0A
     
@@ -705,122 +705,28 @@
     
-  
 str += 
-CubeId.BUG;%0A                    else%0A                        str += CubeId.EMPTY_SPACE;%0A                %7D
+_cubes%5Bi%5D%5Bj%5D;
 %0A   
@@ -740,10 +740,8 @@
   %7D%0A
-*/
 %0A   
@@ -1466,108 +1466,47 @@
 ate 
-HashSet%3CThreeDPoint%3E _level;%0A    private int _layer;%0A    private int _height;%0A    private int _width
+char%5B%5D%5B%5D _cubes;%0A    private int _layer
 ;%0A  

Update Layer.java