import java.util.*;

public class Scaffold
{
    public static final String SCAFFOLDING = "#";
    public static final String OPEN_SPACE = ".";

    // ASCII codes.

    public static final String SCAFFOLDING_CODE = "35";
    public static final String OPEN_SPACE_CODE = "46";
    public static final String NEW_LINE_CODE = "10";

    public Scaffold (boolean debug)
    {
        _image = new Vector<String>();
        _numberOfLines = 0;
        _debug = debug;
    }

    public void addData (String value)
    {
        if ((SCAFFOLDING_CODE.equals(value)) || (OPEN_SPACE_CODE.equals(value)) || (NEW_LINE_CODE.equals(value)))
        {
            _image.add(value);

            if (NEW_LINE_CODE.equals(value))
                _numberOfLines++;
        }
        else
        {
            if (VacuumRobot.isRobotCode(value))
                _image.add(value);
            else
            {
                if (_debug)
                    System.out.println("Invalid code: "+value);
            }
        }
    }

    public void scanForIntersections ()
    {

    }

    @Override
    public String toString ()
    {
        Enumeration<String> iter = _image.elements();
        String str = "";

        while (iter.hasMoreElements())
        {
            String val = iter.nextElement();

            switch (val)
            {
                case SCAFFOLDING_CODE:
                {
                    str += SCAFFOLDING;
                }
                break;
                case OPEN_SPACE_CODE:
                {
                    str += OPEN_SPACE;
                }
                break;
                case NEW_LINE_CODE:
                {
                    str += "\n";
                }
                break;
                default:
                    str += VacuumRobot.print(val);
            }
        }

        return str;
    }

    private Vector<String> _image;
    private int _numberOfLines;
    private boolean _debug;
}
@@ -1060,16 +1060,65 @@
 )%0A    %7B%0A
+        int sizeOfLines = numberOfLineElements();
 %0A    %7D%0A%0A
@@ -1907,24 +1907,444 @@
 str;%0A    %7D%0A%0A
+    private final int numberOfLineElements ()%0A    %7B%0A        int sizeOfLines = 0;%0A        Enumeration%3CString%3E iter = _image.elements();%0A        boolean done = false;%0A%0A        while (iter.hasMoreElements() && !done)%0A        %7B%0A            sizeOfLines++;%0A%0A            String entry = iter.nextElement();%0A%0A            if (NEW_LINE_CODE.equals(entry))%0A                done = true;%0A        %7D%0A%0A        return sizeOfLines;%0A    %7D%0A%0A
     private 

Update Scaffold.java