renamed rect_to_json to .to_tuple