BFS implemented. A bug exists