added dfs and modified bfs