initial write implementation; added serialization functions