private void calculateGreatMargin(Double fieldA, Double factor) {
        if((ourProportion.compareTo(fieldA) <= 0) && ((purchaseCost.compareTo(0.0) != 0) ? minMarginOnPosition.compareTo((minCostOnAll - 0.02) / purchaseCost * 100.0 - 100.0) < 0 : minMarginOnPosition.compareTo(0.0) < 0)) {
            if(settlementCost.compareTo(0.0) != 0) paymentAdjustmentFactor = ((minCostOnAll - 0.02) / settlementCost * 100.0 - 100.0) * ((100.0 + factor) / 100.0);
        } else if((purchaseCost.compareTo(0.0) != 0) ? minMarginOnPosition.compareTo((avarageCostOnAll - 0.02) / purchaseCost * 100.0 - 100.0) < 0 : minMarginOnPosition.compareTo(0.0) < 0) {
            if(settlementCost.compareTo(0.0) != 0) paymentAdjustmentFactor = ((avarageCostOnAll - 0.02) / settlementCost * 100.0 - 100.0) * ((100.0 + factor) / 100.0);
        } else {
            if(settlementCost.compareTo(0.0) != 0) paymentAdjustmentFactor = saleCost / settlementCost * 100.0 - 100.0;
        }
    }