Added BFS that searches the whole graph