Why do you call it PREVIOUS_NODES? For me, it's visitedNodes, right? Why don't use the same name?