public void endGame(GameStatus status) {
	//process players' scores
	score = 1000 - (moves * 10);
	Properties highScores = fetchHighScores();
	List<Integer> scoreList = new ArrayList<Integer>();
	for (Object element : highScores.keySet()) {
	    scoreList.add(Integer.parseInt(element.toString()));
	}
	if (status == GameStatus.WIN) {
	    JOptionPane.showMessageDialog(GameWindow.getInstance(), 
		    "Congrats, you won!");

	    if ((highScores.size() >= 10) 
		    && (score > (Collections.min(scoreList)))) {
		String playerName = JOptionPane.showInputDialog(
			GameWindow.getInstance(),
			"Please enter your name.", "Highscore", 
			JOptionPane.QUESTION_MESSAGE);
		
		highScores.remove(Collections.min(scoreList));
		highScores.setProperty(Integer.toString(score), playerName);
		FileOutputStream fos;
		try {
		    //eliminate the possibility of a FileNotFoundException
		    highScoresFile.createNewFile();
		    fos = new FileOutputStream(highScoresFile);
		    BufferedOutputStream bos = new BufferedOutputStream(fos);
		    highScores.store(bos, playerName);
		} catch (FileNotFoundException ex) {
		    Logger.getLogger(GameEngine.class.getName()).log(
			    Level.SEVERE, "Unable to locate the higbscores "
			    + "file.", ex);
		} catch (IOException ex) {
		    Logger.getLogger(GameEngine.class.getName()).log(
			    Level.SEVERE, "An error occured while attempting "
			    + "to persist the highscore.", ex);
		}
		
		displayHighScores();
	    }

	} else {
	    JOptionPane.showMessageDialog(GameWindow.getInstance(), 
		    "Sorry, you lost.");
	}
	
	int toContinue = JOptionPane.showConfirmDialog(GameWindow.getInstance(),
		"Do you want to play another round?", 
		"Play Again?", JOptionPane.YES_NO_OPTION, 
		JOptionPane.QUESTION_MESSAGE);
	
	if (toContinue == JOptionPane.YES_OPTION) {
            GameWindow.getInstance().dispose();
            BoardImpl.createNew();
            GameWindow.createNew();
            GameEngine.createNew();
            JavaSnakes.main(new String[]{"me"});
            BoardImpl.getInstance().setDieButtonEnabled(true);
	} else {
	    System.exit(0);
	}
    }