Update BFS not to manually specify the root.