public static boolean writeFile(String filePath, String file)
	{
		//Declares new Buffered Writer object
		BufferedWriter writer = null;
		File textFile = new File(filePath);
		try
		{
			//Sets the value of the buffered writer object, including the name of the output file
			writer = new BufferedWriter(new FileWriter(textFile));
			writer.write(file);
		}
		//Tidies up any errors occurring in the try block, and prints 'Write Error' only if there were errors
		catch(IOException e)
		{
			System.err.println("Write Error");
			return false;
		}
		finally
		{
			//Closes the writer, ending the file
			try
			{
				if(writer != null)
					writer.close();
			}
			//Prints 'A different write error' if the writer cannot be closed
			catch(IOException e)
			{
				System.err.println("A different write error");
				return false;
			}
		}
		return true;
	}