added ml_formula function