public static void testSystem(String qPath, String docsPath) {
        window.clearWindow();
        
        // only create docSet once
        if ( docSet == null || !(docsPath.equals(documentsPath)) ) {
            long docStart = System.currentTimeMillis();
            documentsPath = docsPath;
            docSet = new DocumentSet(documentsPath);
            long docEnd = System.currentTimeMillis() - docStart;
            window.print("Document set created in " +docEnd +"ms.");
        }

        // only create querySet once
        if ( querySet == null || !(qPath.equals(queriesPath)) ) {
            long qStart = System.currentTimeMillis();
            queriesPath = qPath;
            querySet = Queries.parseQueries(queriesPath);
            long qEnd = System.currentTimeMillis() - qStart;
            window.print("Query set created in " +qEnd +"ms.");
        }

        long start = System.currentTimeMillis();

        Iterator it = querySet.entrySet().iterator();
        PrintWriter out = null;
        File outFile = new File("results/results.txt");
        outFile.getParentFile().mkdirs();

        try {
            out = new PrintWriter(outFile);

            while (it.hasNext()) {
                Map.Entry entry = (Map.Entry) it.next();
                String qFileName = ((String) entry.getKey()).split("\\.")[0];  // remove .txt
                String query = (String) entry.getValue();

                // TODO: print results etc.
                Map<String, Double> similarities = performQuery(query);

                // print results
                // sort by similarity or by filename
                if ( window.sortBySimilarity() ) {
                    List<Map.Entry> results = Maps.sortMapByValue(similarities);

                    for (Map.Entry e : results) {
                        String f = ((String) e.getKey()).split("\\.")[0];

                        window.print( qFileName +" " +f );
                        // print results in a similar manner to MED.REL
                        out.println( qFileName +" 0 " +f +" 1" );
                    }
                }
                else {
                    List<String> results = Maps.sortMapByKey(similarities);

                    for (String s : results) {
                        String f = s.split("\\.")[0];

                        window.print( qFileName +" " +f );
                        // print results in a similar manner to MED.REL
                        out.println( qFileName +" 0 " +f +" 1" );
                    }
                }   

            }   // end loop though queries
        } catch (Exception e) {
            e.printStackTrace();
        }

        out.close();

        long end = System.currentTimeMillis() - start;
        window.print("Test completed in " +end +"ms.\n");
        window.print("Results output to results.txt");

    }