fixed so DFS returns a path with pair and not Integer