added serialization functions: WIP...