Added curve fitting