public String removeBlocks(String completeCode) {
        int depth = 0;
        String blockContents = "";
        char[] charList = completeCode.toCharArray();

        completeCode = "";

        for(char c : charList) {
            if(c == '{') {
                depth++;
            } else if(c == '}') {
                depth--;
                if(depth == 0) {
                    Block block = new Block(blockContents, getInterpreter());
                    getInterpreter().blocks.put(block.getBlockID(), block);
                    blockContents = "";

                    long blockID = block.getBlockID();
                    completeCode += "=:" + blockID + ";";
                }
            } else {
                if(depth > 0) {
                    blockContents += c;
                } else {
                    completeCode += c;
                }
            }
        }

        return completeCode;
    }