BFS added along with path existence checking