Added Curve fit functionality.