first working version of stream