public void writeStep(int r, int s, Step step, Data stepData, double finalOF) {
        checkFile();
        if (w != null) {
      
            this.writeStepHeader();     
            
            w.println("-------------------------------");
            w.println("Round " + (r+1) + " Step " + step.getName());
            w.println("-------------------------------\n");
            w.println();
               
            w.println("Objective Function Values for round " + (r+1) + " = " + finalOF);
                    
            ParameterData[] paramData = stepData.paramData;
            
            for (int i = 0; i < paramData.length; i++) {
                ParameterData paramInstance = paramData[i];          
                
                w.println(">>> Parameter Name: " + paramInstance.getName());
                w.println();
                w.println("Lower Bound = " + paramInstance.getOriginalLowerBound() );
                w.println("Upper Bound = " + paramInstance.getOriginalUpperBound() );
                w.println();
                
                w.println("Parameter Values:");
                w.println("\t#\tinit value\t\tRound " + r + " data");
                double[] pdata = paramInstance.getDataValue();
                
                
                boolean[] calibrated = paramInstance.getCalibrationFlag();
                int calibrationCount = 0;
                double mean = 0;
                for(int j=0; j<pdata.length; j++) {
                    
                    w.format("\t"+ (j+1) + "\t%f\t\t%f\n", iData.get(inxt),  pdata[j]);
                    inxt++;
                    if (inxt >= iData.size()) inxt = 0;
                    if (calibrated[j]) {
                       mean += pdata[j];
                       calibrationCount++;
                     }
                    
                }
           
                mean = mean/calibrationCount;
                w.println("\tMean\t\t\t" + mean);
                w.flush();
            }          
        
        w.flush();
        }
    }