BFS and DFS are finaly done