protected void fillOutput() {
        String timeStamp = new SimpleDateFormat("yyyyMMddHHmmss").format(Calendar.getInstance().getTime());
        outputTxt = timeStamp + ".lvl";

        title = JOptionPane.showInputDialog("Level Name: ");
        outputTxt = title + ".lvl";
        output.add("<def>");
        output.add("<bgidef>pics/backgrounds/gamePanel.png</bgidef>");

        ArrayList<String> defPaths = new ArrayList();
        defPaths.add("levels/tilepic/tile000.png");

        //adding defpaths
        for (int i = 0; i < tiles.size(); i++) {
            String tilePath = tiles.get(i).getGraphPath();
            boolean found = false;
            for (int j = 0; j < defPaths.size(); j++) {
                if (tilePath.compareToIgnoreCase(defPaths.get(j)) == 0) {
                    found = true;
                }
            }
            if (!found) {
                defPaths.add(tilePath);
            }
        }

        //making tiledefs
        for (int i = 0; i < defPaths.size(); i++) {
            output.add("<tiledef>");
            output.add("<id>" + i + "</id>");
            if (i == 0) {
                output.add("<cost>0</cost>");
            } else {
                output.add("<cost>1</cost>");
            }
            output.add("<path>" + defPaths.get(i) + "</path>");
            output.add("</tiledef>");
        }

        output.add("</def>");
        output.add("<board>");
        output.add("<title>" + title + "</title>");
        output.add("<width>50</width>");
        output.add("<height>50</height>");
        output.add("<default>0</default>");
        output.add("<fill>true</fill>");

        for (int i = 1; i < defPaths.size(); i++) {
            output.add("<overwrite>");
            output.add("<type>" + i + "</type>");
            for (int j = 0; j < tiles.size(); j++) {
                if (tiles.get(j).getGraphPath().compareToIgnoreCase(defPaths.get(i)) == 0) {
                    String tileAdd = tiles.get(j).getLoc();
                    tileAdd = "<tile>" + tileAdd + "</tile>";
                    output.add(tileAdd);
                }
            }
            output.add("</overwrite>");
        }

        output.add("</board>");
    }