@Override
		public void mouseReleased(MouseEvent e) {
			if (!isListening) return;

			//can only click if dirty is not true
			boolean left = e.getButton() == MouseEvent.BUTTON1;
			boolean right = e.getButton() == MouseEvent.BUTTON3;

			if (!dirty) {
				int xClick = e.getX() / squareSize;
				int yClick = e.getY() / squareSize;

				switch (clickMode) {
				case both: 
					controller.bothClick(xClick, yClick); 
					break;
				case left:
					controller.leftClick(xClick, yClick); 
					break;
				default:
					break;
				}

				clickMode = ClickMode.none;
				dirty = true;

				repaint();
			}

			if (left) leftClicked = false;
			else if (right) rightClicked = false;
		}