added to_json functianality