important fix in model_and_analyze