public void processFiles(
            Boolean outputCounts,
            Boolean outputDistances,
            File directory, 
            Dictionary dictionary1, 
            Dictionary dictionary2, 
            String delimiter, 
            Boolean audit, 
            MainFrame mf,
            Writer output) {
        for (File file: directory.listFiles()) {
            if (file.isDirectory()) {
                processFiles(outputCounts, outputDistances, file, dictionary1, dictionary2, delimiter, audit, mf, output);
            } else {
                if (file.getName().endsWith(".txt")) {
                    try {
                        String audit_name = file.getName();
                        audit_name = audit_name.substring(0, audit_name.lastIndexOf("."));

                        mf.writeToOutput("Processing " + file.getPath() + "...\n");

                        dictionary1.reset(); dictionary2.reset();
                        FileWriter auditFile = null;
                        if (audit) {
                            auditFile = new FileWriter(file.getParent() + "/" + audit_name + "_audit.dat");
                            dictionary1.audit = auditFile; dictionary2.audit = auditFile;
                            auditFile.write("FORMAT FOR WORD MATCHES:\n");
                            auditFile.write("[Line Number],[Word Number]:WORD MATCH,[PRE|POST-ANALYST|POST-COMPANY],[word found],[stem],[Dictionary]:[category]\n");
                            auditFile.write("\nFORMAT FOR DISTANCE MATCHES:\n");
                            auditFile.write("[Line Number]:DISTANCE MATCH,[PRE|POST-ANALYST|POST-COMPANY],[Dictionary 2 Word],[Dictionary 2 Word Number],[Dictionary 1 Word],[Dictionary 1 Word Number],[Number of words between],[Dictionary 2]:[category]\n\n");
                        }
                        
                        processFile(outputCounts, outputDistances, dictionary1, dictionary2, file, delimiter, output);
                        if (audit) auditFile.close();
                    } catch (IOException ioe) {
                        
                    }
                }
            }
        }
    }