BFS almost working