Writing the models