Added support for list and bfs.