public void rotate(boolean clockwise) {
		int turns;
		if (clockwise)
			turns = 1;
		else
			turns = 3;
		for (int k = 1; k <= turns; k++) {
			boolean sec[][] = new boolean[getHeight()][getWidth()];

			for (int i = 0; i < getHeight(); i++) {
				for (int j = getWidth() - 1; j >= 0; j--) {
					sec[i][getWidth() - 1 - j] = matrix[j][i];
				}
			}
			matrix = sec;

		}
	}