added dfs and bfs implementation