Doesn't this mean we're extending visited_nodes with an empty list every time this is called?