updated serialization example