added option to use the kalman smoother in the fit