Changed 0 to UNVISITED in traverse method