Updated Main to match that of BFS