bug solved ; dfs and bfs working