public boolean bj(Polygon aq[], int l, int i1) {
		do {
			Polygon q1 = aq[l];
			for (int j1 = l + 1; j1 <= i1; j1++) {
				Polygon q2 = aq[j1];
				if (!ph(q2, q1))
					break;
				aq[l] = q2;
				aq[j1] = q1;
				l = j1;
				if (l == i1) {
					lp = l;
					mp = l - 1;
					return true;
				}
			}

			Polygon q3 = aq[i1];
			for (int k1 = i1 - 1; k1 >= l; k1--) {
				Polygon q4 = aq[k1];
				if (!ph(q3, q4))
					break;
				aq[i1] = q4;
				aq[k1] = q3;
				i1 = k1;
				if (l == i1) {
					lp = i1 + 1;
					mp = i1;
					return true;
				}
			}

			if (l + 1 >= i1) {
				lp = l;
				mp = i1;
				return false;
			}
			if (!bj(aq, l + 1, i1)) {
				lp = l;
				return false;
			}
			i1 = mp;
		} while (true);
	}