Implemented some function to load/save models.