public void open(int i, int j) {
		// open site (row i, column j) if it is not already
		op[j * length + i] = 1;
		int up = Integer.MAX_VALUE;
		int down = Integer.MAX_VALUE;
		int left = Integer.MAX_VALUE;
		int right = Integer.MAX_VALUE;
		if (op[(j - 1) * length + i] == 1) {
			up = id[(j - 1) * length + i];
		}
		if (op[(j + 1) * length + i] == 1) {
			down = id[(j + 1) * length + i];
		}
		if (op[j * length + i - 1] == 1) {
			left = id[j * length + i - 1];
		}
		if (op[j * length + i + 1] == 1) {
			right = id[j * length + i + 1];
		}
		int root = Math.min(
				Math.min(Math.min(Math.min(up, down), left), right), id[j
						* length + i]);
		id[j * length + i] = root;
		if (op[(j - 1) * length + i] == 1) {
			id[(j - 1) * length + i] = root;
		}
		if (op[(j + 1) * length + i] == 1) {
			id[(j + 1) * length + i] = root;
		}
		if (op[j * length + i - 1] == 1) {
			id[j * length + i - 1] = root;
		}
		if (op[j * length + i + 1] == 1) {
			id[j * length + i + 1] = root;
		}
	}