started code for streaming