Don't add unvisited states to visited set