Added some functions to the models.