public boolean isThereSomethingInBetween(int inv, int var) {
        Box varBox = getUpperLeftBoxOfVariant(var);
        Box invBox = getUpperLeftBoxOfInvariant(inv);
        // discard limit cases where two boxes are adjacent somehow
        if (varBox.distance(invBox)<=TOO_CLOSE_THRESHOLD) return false;
        int nInv = this.matrix.getNumberOfInvariants();
        for(int i=0; i<nInv; i++) {
            if (i==inv) continue;
            if (isThereBoxInBetween(invBox, varBox, getBoxesOfInvariant(i)))   
                return true;
        }
        int nVar = this.matrix.getNumberOfVariants();
        for(int v=0; v<nVar; v++) {
            if (v==var) continue;
            if (isThereBoxInBetween(invBox, varBox, getBoxesOfVariant(v)))  
                return true;
        }
        return false;
    }