rewrite the model.py