DFS implementation

Few bug fixes while creating the graph