public void createGUI() {
		
		//initializing the game grid
		gameButtonGrid = new JPanel();
		gameButtonGrid.setLayout(new GridLayout(mmg.getMaxGuessAmt(),4));
		gameButtonGrid.setPreferredSize(new Dimension(320,320));
		Integer i = 1;
		Integer x = 0;
		Integer y = 0;
		
		hintPanel = new JPanel();
		hintPanel.setLayout(new GridLayout(mmg.getMaxGuessAmt()*2,2));
		hintPanel.setPreferredSize(new Dimension (80,320));
		for(int k = 0; k < mmg.getMaxGuessAmt() * 4; k++) {
			//int m = mmg.getMaxGuessAmt()*4-k;
			int mod = mmg.getMaxGuessAmt() - k/4;
			button = new JButton();
			button.setName("" + mod);
			button.setPreferredSize(new Dimension(10,10)); //was 40, 40
			hintPanel.add(button, k);
			button.setText(button.getName());
			button.setEnabled(false);
			button.setToolTipText("Hint for guess " + mod);
		}
		
		GridHandler gridButtonHandler = new GridHandler(mmg, this);
		HotkeyHandler hotkey = new HotkeyHandler(this);
		//adding the buttons to the grid
		while (i <= mmg.getMaxGuessAmt() * 4) {
			
			button = new JButton();
			//Dummy used to make sure user doesn't double click
			button.setText("clear");
			button.setForeground(Color.gray);
			button.setBackground(Color.gray);
			
			//Give them a label?
			String label = "";
			label = label.concat(x.toString());
			label = label.concat(y.toString());
			button.setName(label);
			//button.setText(label);
			
			//Set size
			button.setPreferredSize(new Dimension(30, 30));
			button.addActionListener(gridButtonHandler);
			button.addKeyListener(hotkey);
			gameButtonGrid.add(button);
			i++;
			
			//Lock buttons above the guess row
			if (i < (mmg.getMaxGuessAmt() * 4 - 2)) {
				button.setEnabled(false);
			}
			
			if (x < 3) {
				x++;
			} else {
				x = 0;
				y++;
			}
		}
				
		inputLabel = new JPanel();
		//making room for the input label	
		inputLabel.setLayout(new FlowLayout());
		inputLabel.setForeground(Color.white);		
		
		//creating label to indicate selected input	
		JPanel inputLabel = new JPanel();	
		JLabel title = new JLabel("Selected Input:");	
		title.setForeground(Color.black);
		JLabel input = new JLabel("None");
		input.setForeground(Color.black);		
		
		this.inputIndicator = input;
		
		//Make timer
		//creating label to indicate selected input	
		JPanel timerPanel = new JPanel();	
		JLabel timerLabel = new JLabel("Time is: ");	
		timerLabel.setForeground(Color.black);
		inputTimer = new JLabel("0 sec passed");
				
		//Only instantiate timer once
		if (timerSet == false) {
			setupTimer();
			timerSet = true;
		} else {
			resetTimer();
		}
				
		timerLabel.setForeground(Color.black);		
		timerPanel.add(timerLabel, BorderLayout.NORTH);		
		timerPanel.add(inputTimer, BorderLayout.SOUTH);	
		
		//Add all the stuff onto the input label
		inputLabel.add(title, BorderLayout.NORTH);		
		inputLabel.add(input, BorderLayout.SOUTH);	
		inputLabel.add(timerPanel, BorderLayout.EAST);
		
		//Making the input grid
		JPanel inputGrid = new JPanel();
		inputGrid.setLayout(new GridLayout(3,3));
		inputGrid.setPreferredSize(new Dimension(200,200));
		inputGrid.setOpaque(false);
		
		InputColourHandler inputHandler = new InputColourHandler(this);
		
		//Set up inputs
		button = new JButton();
		button.setName("red");
		button.setText("RED");
		button.setBackground(Color.red);
		button.setOpaque(true);
		button.setPreferredSize(new Dimension(40, 40));			
		button.addActionListener(inputHandler);	
		button.addKeyListener(hotkey);
		button.setToolTipText("Click on this button then on the grid to change the colour!");
		inputGrid.add(button);			
		
		button = new JButton();
		button.setName("green");
		button.setText("GREEN");
		button.setBackground(Color.green);	
		button.setOpaque(true);
		button.setPreferredSize(new Dimension(40, 40));			
		button.addActionListener(inputHandler);	
		button.addKeyListener(hotkey);
		button.setToolTipText("Click on this button then on the grid to change the colour!");
		inputGrid.add(button);		
		
		button = new JButton();
		button.setName("blue");
		button.setBackground(Color.blue);
		button.setText("BLUE");
		button.setOpaque(true);
		button.setPreferredSize(new Dimension(40, 40));			
		button.addActionListener(inputHandler);	
		button.addKeyListener(hotkey);
		button.setToolTipText("Click on this button then on the grid to change the colour!");
		inputGrid.add(button);		
		
		button = new JButton();
		button.setName("yellow");
		button.setText("YELLOW");
		button.setBackground(Color.yellow);
		button.setOpaque(true);
		button.setPreferredSize(new Dimension(40, 40));			
		button.addActionListener(inputHandler);	
		button.addKeyListener(hotkey);
		button.setToolTipText("Click on this button then on the grid to change the colour!");
		inputGrid.add(button);		
		
		button = new JButton();
		button.setName("white");
		button.setText("WHITE");
		button.setBackground(Color.white);
		button.setOpaque(true);
		button.setPreferredSize(new Dimension(40, 40));			
		button.addActionListener(inputHandler);	
		button.addKeyListener(hotkey);
		button.setToolTipText("Click on this button then on the grid to change the colour!");
		inputGrid.add(button);		
		
		button = new JButton();
		button.setName("pink");
		button.setText("PINK");
		button.setBackground(Color.pink);	
		button.setOpaque(true);
		button.setPreferredSize(new Dimension(40, 40));			
		button.addActionListener(inputHandler);	
		button.addKeyListener(hotkey);
		button.setToolTipText("Click on this button then on the grid to change the colour!");
		inputGrid.add(button);		
		
		//input panel consists of the input grid and the input label		
		JPanel inputPanel = new JPanel();		
		inputPanel.setLayout(new BorderLayout());		
		inputPanel.add(inputLabel, BorderLayout.NORTH);	
		inputPanel.add(inputGrid, BorderLayout.CENTER);
		
		//Move timer here 
		
		
		//making miscellaneous buttons		
		JPanel miscButtons	= new JPanel();	
		MiscHandler miscButtonHandler = null;
		
		//Check if versing ai
		if (ai != null) {
			miscButtonHandler = new MiscHandler(mmg, this, ai);	
		} else {
			miscButtonHandler = new MiscHandler(mmg, this, null);	
		}
		
		miscButtons.setLayout(new GridLayout(5,1));
		miscButtons.setPreferredSize(new Dimension(100, 180));
		
		button = new JButton("Check");	
		button.setPreferredSize(new Dimension(100, 50));		
		button.addActionListener(miscButtonHandler);	
		button.setToolTipText("Click on this button to check if you are correct!");	
		button.addKeyListener(hotkey);
		miscButtons.add(button);		
		
		button = new JButton("Clear");		
		button.setPreferredSize(new Dimension(100, 50));		
		button.addActionListener(miscButtonHandler);
		button.setToolTipText("Click on this button to clear your current guess!");
		button.addKeyListener(hotkey);
		miscButtons.add(button);
		
		//Check if multiplayer
		if (this.getClient() == null) {
			button = new JButton("Reset");		
			button.setPreferredSize(new Dimension(100, 50));		
			button.addActionListener(miscButtonHandler);
			button.setToolTipText("Click on this button to reset the whole puzzle!");
			button.addKeyListener(hotkey);
			miscButtons.add(button);
		}
		
		button = new JButton("Exit");		
		button.setPreferredSize(new Dimension(100, 50));		
		button.addActionListener(miscButtonHandler);
		button.setToolTipText("Click on this button to go back to start menu!");
		button.addKeyListener(hotkey);
		miscButtons.add(button);
		
		//Add instructions button
		button = new JButton("Rules");
		button.setPreferredSize(new Dimension(100, 50));
		button.addActionListener(miscButtonHandler);
		button.setToolTipText("Click on this button to look at instructions!");
		button.addKeyListener(hotkey);
		miscButtons.add(button);
		//Duplicate here!!!
		//checkBox = new JCheckBox("Allow duplicates");
		//miscButtons.add(checkBox);
		//miscButtons.setPreferredSize(new Dimension(230, 150));
		
		//creating label to indicate selected input	
		JPanel player1Panel = new JPanel();	
		JLabel playerLabel = new JLabel("Player 1");	
		playerLabel.setForeground(Color.black);
		player1Panel.setLayout(new FlowLayout());
		player1Panel.add(playerLabel);
		//inputTimer = new JLabel("0 sec passed");
		
		//Only instantiate timer once
//		//if (timerSet == false) {
//		//	setupTimer();
//			timerSet = true;
//		} else {
//			resetTimer();
//		}
		
//		timerLabel.setForeground(Color.black);		
//		timerPanel.add(timerLabel, BorderLayout.NORTH);		
//		timerPanel.add(inputTimer, BorderLayout.SOUTH);		
				
		//initializing the final frame
		JPanel finalFrame = new JPanel();
		gameButtonGrid.setOpaque(false);
		inputPanel.setOpaque(false);
		miscButtons.setOpaque(false);
		inputIndicator.setOpaque(false);
		finalFrame.setLayout(new BorderLayout());
		
		//adding panels to the window
		finalFrame.add(gameButtonGrid, BorderLayout.CENTER);	
		finalFrame.add(inputPanel, BorderLayout.SOUTH);
		finalFrame.add(hintPanel, BorderLayout.EAST);
		finalFrame.add(miscButtons, BorderLayout.WEST);
		finalFrame.add(player1Panel, BorderLayout.NORTH);
		finalFrame.setSize(700,700);	
		
		//Creating label to waste space
		//Only created if more than 1 player
		if (player == 2) {
			JPanel player2Panel = new JPanel();	
			JLabel name = new JLabel("Player");	
			name.setForeground(Color.black);
			JLabel label = new JLabel("2");
			label.setForeground(Color.black);		
			player2Panel.add(name, BorderLayout.NORTH);		
			player2Panel.add(label, BorderLayout.SOUTH);
			
			//Create a space waster - no longer a space waster!!
			JPanel turnIndicatorPanel = new JPanel();
			JLabel turnIndicatorLabel = new JLabel(turnIndicator); //TODO Modify this label to show whos turn it is!! 
			turnIndicatorPanel.add(turnIndicatorLabel, BorderLayout.CENTER);
			turnIndicatorPanel.setPreferredSize(new Dimension(200, 230));
			
			
			//Create space waster
			JPanel temp2 = new JPanel();
			JLabel t2 = new JLabel();
			temp2.add(t2, BorderLayout.CENTER);
			temp2.setLayout(new GridLayout(3, 3));
			temp2.setPreferredSize(new Dimension(50, 200));
			
			//initialize player 2 frame
			p2Panel = new JPanel();
			initialisep2Grid();
			p2gameButtonGrid.setOpaque(false);
			p2hintPanel.setOpaque(false);
			player2Panel.setOpaque(false);
			turnIndicatorPanel.setOpaque(false);
			temp2.setOpaque(false);
			p2Panel.setLayout(new BorderLayout());
			
			//Add to frame
			p2Panel.add(p2gameButtonGrid, BorderLayout.CENTER);
			p2Panel.add(p2hintPanel, BorderLayout.EAST);
			p2Panel.add(player2Panel, BorderLayout.NORTH);
			p2Panel.add(turnIndicatorPanel, BorderLayout.SOUTH);
			p2Panel.add(temp2, BorderLayout.WEST);
			p2Panel.setSize(700,700);	
		}
		
		//Title for game
		JPanel titlePanel = new JPanel();
		JLabel titleOfGame = new JLabel();
		titleOfGame.setText("Mastermind - The Game of Colours");
		titleOfGame.setFont(new Font("TimesRoman", Font.BOLD, 28));
		titlePanel.setLayout(new FlowLayout());
		titlePanel.add(titleOfGame);
		
		//Final frame
		JFrame mastermindFrame = new JFrame("Mastermind");
		mastermindFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);	
		mastermindFrame.setLayout(new BorderLayout());
		
		if (player == 2) {
			mastermindFrame.add(finalFrame, BorderLayout.WEST);
			mastermindFrame.add(p2Panel, BorderLayout.CENTER);
		} else {
			mastermindFrame.add(finalFrame, BorderLayout.CENTER);
		}
		
		mastermindFrame.add(titlePanel, BorderLayout.NORTH);
		mastermindFrame.pack();
		mastermindFrame.setResizable(true);
		mastermindFrame.setBackground(Color.orange);
		this.gameGrid = mastermindFrame;
		
		//Make the grid for mastermind
		this.gameGrid.setVisible(true);
	}