private int clear() {
		int lines = 0;

		for (int j = 0; j < height; j++) {
			// Assume full row
			boolean full = true;

			for (int i = 0; i < width; i++) {
				if (getBlock(i, j) == null) {
					full = false;
					break;
				}
			}

			// Continue to next row if not full
			if (!full) {
				continue;
			}

			lines++;

			// Move blocks down
			for (int k = j; k > 0; k--) {
				for (int i = 0; i < width; i++) {
					matrix[i][k] = matrix[i][k - 1];
				}
			}

			// Clear top row
			for (int i = 0; i < width; i++) {
				matrix[i][0] = null;
			}
		}

		if (lines > 0) {
			setChanged();
		}

		return lines;
	}