@Override
	public void mouseReleased(MouseEvent mouse) {
		Component comp = mouse.getComponent();
		if (comp == null) {
			return;
		}
		
		//Creation Menu
		if (comp == startButton) {
			this.xSize = (int) xSizeSpinner.getModel().getValue();
			this.ySize = (int) ySizeSpinner.getModel().getValue();
			this.colourSize = (int) colourSizeSpinner.getModel().getValue();
			this.guesser = codebreakerCheckbox.isSelected();
			
			frame.remove(menuPanel);
			
			mastermindPanel = initialisePanel();
			createMastermindPanel(mastermindPanel);
			
			mastermindPanel.setLayout(null);
			
			frame.add(mastermindPanel);
			
			frame.repaint();
			
			mmHandler = new MastermindHandler(this, this.ySize, this.colourSize, this.codeSlots, this.guesser);
			
			startButton.removeMouseListener(this);
		}
		
		
		//GamePlay
		if (comp == picker) {
			this.curColour = picker.getColour(mouse.getX(), mouse.getY());
			return;
		}
		
		if (comp == slots) {
			slots.setColour(mouse.getX(), mouse.getY(), curColour);
			return;
		}
		
		if (comp == codeSlots) {
			codeSlots.setColour(mouse.getX(), mouse.getY(), curColour);
			return;
		}
		
		if (comp == readyButton) {
			if (guesser && codeSlots.isColumnFull(0)) {
				codeSlots.setColumnLocked(0, true);
				
				mmHandler.setCode(codeSlots.getColumn(0));
				mmHandler.startGuessing();
				
				mastermindPanel.remove(readyButton);
				readyButton.removeMouseListener(this);
				
				frame.repaint();
				return;
			}
			if (!guesser && slots.isColumnFull(this.curColumn)) {
				mmHandler.setGuess(slots.getColumn(curColumn));
				mmHandler.compare(markslots, curColumn);
				
				if (this.curColumn == this.xSize-1) {
					this.mastermindPanel.remove(readyButton);
					return;
				}
				curColumn++;
				slots.setColumnCovered(curColumn, false);
				slots.setColumnLocked(curColumn-1, true);
				return;
			}
		}
	}