updated for stream to stream