public Game winner() throws WinnerErrorException, BoardErrorException, ButtonsNotMadeException, ButtonCanNotBeClickedException { // determines who is the winner

		//testing purposes to get the values , X or O
		//templateOfBoard[0] = 'O';
		//templateOfBoard[4] = 'O';
		//templateOfBoard[8] = 'O';

		//list below defines all the possible win combinations 
		// the index of where a X or O can be place
		// placed the locations to a int value 
		int win1 = templateOfBoard[0] + templateOfBoard[1] + templateOfBoard[2];	
		int win2 = templateOfBoard[3] + templateOfBoard[4] + templateOfBoard[5];
		int win3 = templateOfBoard[6] + templateOfBoard[7] + templateOfBoard[8];
		int win4 = templateOfBoard[0] + templateOfBoard[3] + templateOfBoard[6];
		int win5 = templateOfBoard[1] + templateOfBoard[4] + templateOfBoard[7];
		int win6 = templateOfBoard[2] + templateOfBoard[5] + templateOfBoard[8];
		int win7 = templateOfBoard[0] + templateOfBoard[4] + templateOfBoard[8];
		int win8 = templateOfBoard[2] + templateOfBoard[4] + templateOfBoard[6];

		//System.out.println("count = " + count); // testing 
		//System.out.println("vaules at win7 = " + win7 + " is a win when 264 or 237");  testing

		int[] win = new int[]{win1,win2,win3,win4,win5,win6,win7,win8}; 
		// making a array to go through all the possibile wins 
		//possible total of wins is 8


		for(int i = 0;i<win.length;i++){	 
			// looping through the win possibilities 
			//System.out.println(win.length); testing 
			//System.out.println(win[i] + "     " + (i+1)); testing 

			if(win[i] == 264){ // if one of the the combinations equal 'X','X','X' which equals 264, then there is a winner 
				System.out.println("X is the winner!!!");	
				System.out.println("Game Over!");
				//System.exit(0);
				try {
					gameOver("X is the Winner");
				} catch (CouldNotPlayAgainException | NoCancelOption e) {
					e.printStackTrace();
				}
				//System.out.print("X Hello " + "win " + (i+1) + " value =  "  + win[i]); testing 
				return this; // if statement is true, it will return this(gameOver)
			}
			else if(win[i] == 237 ){ // if one of the the combinations equal 'O','O','O' which equals 234, then there is a winner 
				System.out.println("O is the winner!!!");
				System.out.println("Game Over!");
				//System.out.println(templateOfBoard[0]+templateOfBoard[1]+templateOfBoard[2]);
				try {
					gameOver("O is the Winner");
				} catch (CouldNotPlayAgainException | NoCancelOption e) {
					e.printStackTrace();
				} // if statement is true, it will return this(gameOver)
				//System.out.print("O Hello1");
				return this;

			}
		} 

		//
		if (count == 9) {
			// if none of the statements above are true, it automatically comes done to here
			//so if there is nine moves and no win, it is a draw 
			try {
				gameOver("Draw");
			} catch (CouldNotPlayAgainException | NoCancelOption e) {
				e.printStackTrace();
			}

		}

		return this; 
		// going to return this method ;
	}