Added Code for Serialization and Deserialization