Added sample serialization code