Added a method to Model to_dict