Slight modifications in CurveFitting.cs