added bfs and dfs