BFS for walls