implemented serialization and deserialization from mtrees