private void renderCode()
    {
        List<DrawNode> rootDrawNodes = getRootNodes();

        for(DrawNode rootDrawNode : rootDrawNodes) {
            List<Pair<Node, Node>> newConnections = new ArrayList<Pair<Node, Node>>();
            Node rootNode = rootDrawNode.getNode();

            for (Pair<DrawNode, DrawNode> connection : connections)
            {
                DrawNode from = connection.fst;
                DrawNode to = connection.snd;

                Node fst = from.getNode();
                Node snd = (to == rootDrawNode) ? rootNode : to.getNode();

                newConnections.add(new Pair<Node, Node>(fst, snd));
            }

            GraphTraverser transverser = new GraphTraverser(newConnections, rootNode);
            String output = transverser.traverse();
            
            JFileChooser jfc = new JFileChooser();
            jfc.showSaveDialog(frame);

            File file = jfc.getSelectedFile();

            try
            {
                FileWriter writer = new FileWriter(file);
                writer.write(output);
                writer.close();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
        }
    }