added some code to the models