[mod] BFS traversal instead of DFS