Updated:
 - We save the visited nodes to save us of computing repeated nodes.