public void accessCell(int accessType,int x,int y)
	{		
		if (accessType == 0) { //reveal

			if (!cells[x][y].getRevealed() && !cells[x][y].getFlagged()) { //note if a cell is flagged in cannot be revealed until unflagged
				score--;

				cells[x][y].setRevealed(true);

				if (cells[x][y].getMined()) { //this is the game over condition, a cell containing a mine is clicked
					cells[x][y].setExploded(true);
					gameOver(); //as such it triggers the gameOver method
				}
				else {
					revealAdjacentSquares(x,y);
				}
			}
		}
		else if (accessType == 1) { //flag
			if (!cells[x][y].getRevealed() && !cells[x][y].getFlagged() && getFlagsRemaining() > 0) { //flag the cell
				score--; //note that score is in both the if and else if rather than simply executing before the if statement, this is because if the if or else if are not true, the score should not be decremented, as the user has not taken an action
				cells[x][y].setFlagged(true);
				flagsRemaining--;
			}
			else if(cells[x][y].getFlagged()) { //unflag the cell
				score--;
				cells[x][y].setFlagged(false);
				flagsRemaining++;
			}
		}
		
		checkWinCondition();

		setChanged();
		notifyObservers(); //to update the view of the board
	}