@Override
	public void mouseReleased(MouseEvent e) {
		Point p = e.getPoint();
		int[] cubie = getCubie(p);
		if (cubie != null) {
			display.undoneActions.clear();
			if (cubie[1] == 1 && cubie[2] == 1) {
				String turn = "";
				if (e.getButton() == 1) {
					turn = this.getSide(getColor(cubie)).getName();
					turn(getColor(cubie));
				} else if (e.getButton() == 2) {
					turn = this.getSide(getColor(cubie)).getName() + "2";
					for (int i = 0; i < 2; i++) {
						turn(getColor(cubie));
					}
				} else if (e.getButton() == 3) {
					turn = this.getSide(getColor(cubie)).getName() + "I";
					for (int i = 0; i < 3; i++) {
						turn(getColor(cubie));
					}
				}
				display.actions.add("t:" + turn);
			} else {
				display.actions.add("c:" + cubie[0] + "," + cubie[1] + "," + cubie[2] + "," + getColor(cubie).getInt() + "," + selected.getInt());
				setPiece(cubie, selected);
			}
		}
	}