working bfs to test if two cells can reach eachother