updated model fitting module