Finished serialization code