slight modification to fit_analytic