add serialization and deserialization. pretty simple.