bfs is like dfs