private static void createVMF() throws IOException {
        boolean savingFlag = true;
        int iterations = 1;
        //this loop creates a file with an indexed value on the end
        //instead of failing to save or overwriting
        while (savingFlag) {
            File f = new File(generatedFilename + ".vmf");
            if (f.exists() && !f.isDirectory()) {
                if (iterations == 1) {
                    generatedFilename = generatedFilename + "(" + iterations + ")";
                } else {
                    generatedFilename = generatedFilename.substring(0, generatedFilename.length() - 3) + "(" + iterations + ")";
                }
                iterations++;
            } else {
                try {
                    writer = new PrintWriter(generatedFilename + ".vmf", "UTF-8");
                } catch (IOException io) {
                    throw new IOException("\nCoudn't make the file named " + generatedFilename + ".\n" + io);
                }
                savingFlag = false;
            }
        }
    }