new code and first draft for the model