Streaming.  WIP not pretty.
clean up the code