fixed the curve fitting :D