adding to_schema and to_dict