rename function and add new BFS feature