Adding save model code