BFS test improvement