@Override
	public void mousePressed(MouseEvent e) {
		Tile temp = (Tile) e.getSource();
		System.out.println("x: " + temp.x + "y: " + temp.y + "z: " + temp.z);
		if (isFree(temp) && firstTileSelected == null) {
			firstTileSelected = temp;
			select(firstTileSelected);
			return;
		} else if (temp == firstTileSelected) {
			secondTileSelected = null;
			return;
		} else
			secondTileSelected = temp;

		if ((isFree(secondTileSelected))
				&& secondTileSelected.type.equals(firstTileSelected.type)) {
			unSelect(firstTileSelected);
			PlayClip removeSound = new PlayClip("stone-scraping.wav");
			if (soundsetting)
				removeSound.play();

			firstTileSelected.zOrder = firstTileSelected.getParent()
					.getComponentZOrder(firstTileSelected);
			this.remove(firstTileSelected);
			secondTileSelected.zOrder = secondTileSelected.getParent()
					.getComponentZOrder(secondTileSelected);

			this.remove(secondTileSelected);
			undo.addToUndo(firstTileSelected, secondTileSelected);
			if (undo.undoStack.size() == 144)
				playCongrats();
			firstTileSelected.removeMouseListener(this);
			secondTileSelected.removeMouseListener(this);

			Holder[firstTileSelected.x][firstTileSelected.y][firstTileSelected.z] = null;
			Holder[secondTileSelected.x][secondTileSelected.y][secondTileSelected.z] = null;

			firstTileSelected = null;
			secondTileSelected = null;
			undo.validate();
		} else if (isFree(secondTileSelected)) {
			unSelect(firstTileSelected);
			firstTileSelected = secondTileSelected;
			secondTileSelected = null;
			select(firstTileSelected);
			return;
		}
	}