public void saveGame() {
		File file = new File("Saved_Games.txt");
		FileWriter writer;
		boolean flag = false;
		ArrayList<String> data = new ArrayList<String>();
		ListIterator<String> iterator;
		String currentPuzzle = getCurrentPuzzle();
		try {
			Scanner s = new Scanner(file);
			while(s.hasNextLine()) {
				data.add(s.nextLine());
			}
			s.close();

			iterator = data.listIterator();
			while(iterator.hasNext()) {
				if(iterator.next().equals(user.getUsername())) {
					iterator.next();
					iterator.set(difficulty);
					iterator.next();
					iterator.set("9x9");
					iterator.next();
					iterator.set(String.valueOf(currentTime));
					iterator.next();
					iterator.set(String.valueOf(numberOfHints));
					if(iterator.hasNext()) {
						iterator.next();
						iterator.set(currentPuzzle);
						flag = true;
						break;
					} else {
						data.add(currentPuzzle);
						break;
					}
				}
			}
			if(flag == false) {
				data.add(user.getUsername());
				data.add(difficulty);
				data.add("9x9");
				data.add(String.valueOf(currentTime));
				data.add(String.valueOf(numberOfHints));
				data.add(currentPuzzle);
			}
			writer = new FileWriter("Saved_Games.txt");
			iterator = data.listIterator();
			while(iterator.hasNext()) {
				writer.write(iterator.next());
				writer.write("\n");
			}
			writer.close();
		}
		catch (FileNotFoundException e) {
			JOptionPane.showMessageDialog(null, "Could not find Saved_Games. Contact system administrator.", "Error", JOptionPane.ERROR_MESSAGE);
		}
		catch (IOException e) {
			JOptionPane.showMessageDialog(null, "Could not update Saved_Games. Contact system administrator.", "Error", JOptionPane.ERROR_MESSAGE);
		}
		setUserSavedGame("true");
		user.setHasSavedGame(true);
	}