public void finishUp(){
        while(level > 0) {
            if (level == 4) {
                level -= 1;
            } else if (level == 3) {
                autoIndentation();
                level -= 1;
                result += "</subsection>\n";
            } else if (level == 2) {
                autoIndentation();
                level -= 1;
                result += "</section>\n";
            } else if (level == 1) {
                level -= 1;
                result += "</document>\n";
            }
        }
    }