dfs needs to keep track of the visited nodes somehow...