private boolean isAppendable(final AngleUnitFlapPattern pattern, final int from, final Piece piece) {

		int tailOfAddition = from + piece.size() - 1;

		// overlength.
		if (tailOfAddition > tailIndex) {
			trace("not appendable: index overrun");
			return false;
		}

		// empty?
		for (int i = from + 1; i < tailOfAddition; i++) {
			if (!pattern.isEmptyAt(i)) {
				trace("not appendable: alredy filled");
				return false;
			}
		}

		// need connection.
		if (pattern.isEmptyAt(from) || pattern.getAt(from) == piece.getLineAt(0)) {
		} else {
			trace("not appendable: start line does not have connection");
			return false;
		}

		if (pattern.isEmptyAt(tailOfAddition) || pattern.getAt(tailOfAddition) == piece.getLast()) {
			trace("APPENDABLE: end line has connection");
			return true;
		}
		return false;
	}