use single list to iterate BFS