adding multi-stream capability to bfs