public static void doSearch(final Environment env, final String outFileName, final long endTime) {
				
		// Create a new search and attempt to do our setup
		Search search = new Search(env, endTime);
		search.setup();
		if (search.getSolveable()) {
			// If we haven't already exceeded the time limit...
			if (System.currentTimeMillis() < endTime) {
			
				// Begin the hunt!
				search.letsSearching();
			}
		
			// Either way, we need to report what we've got now
			examSchedule.Solution bestSolution = search.getBestSolution();
			if (bestSolution != null) {
			
				if (bestSolution.isValidSolution() == false)
					System.out.println("solution is invalid");
				
				String output = bestSolution.toString();

				
				System.out.println(search.getBestSolution().toString());

				BufferedWriter writer;
				try {
					writer = new BufferedWriter(new FileWriter(outFileName));
					writer.write(output);
					writer.close();
				}
				catch (IOException e) {
					System.err.println("Failed to write output");
					return;
				}			
			} else {
				System.out.println("Failed to find anything");
			}
		} else {
			System.out.println("Failed to find anything");
		}
	}