Updated the model functions