added serialization to stream/tables