added serialization functions