added BFS and DFS