serialization/deserialization, first crack. It is ugly