Added basic serialization and deserialization