public int bestPolynomialFit(){
        this.methodUsed = 3;
        this.sampleErrorFlag = true;
        this.titleOne = "Best polynomial fitting: r = c[0] + c[1].a +  c[1].a^2 + ... + c[n].a^n; best fit degree (n) = ";
        if(!this.setDataOneDone)this.setDataOne();
        ArrayList<Object> al = super.bestPolynomial();
        this.bestPolyDegree = ((Integer)al.get(0)).intValue();
        this.titleOne += " " + this.bestPolyDegree;
        for(int i=0; i<this.nInterp; i++){
            this.calculatedResponses[i] = 0.0;
            for(int j=0; j<=this.bestPolyDegree; j++){
                this.calculatedResponses[i] +=  super.best[j]*Math.pow(interpolationConcns[i], j);
            }
        }
        if(!this.supressPlot)this.plott();
        this.curveCheck(this.methodIndices[this.methodUsed]);
        return super.bestPolynomialDegree;
    }