Fitting model. For some reason getting NaNs