NOT putting everything in the visited list makes the dfs SLOWER??
added some time measuring to see which version works better
merged the optimizing thing
resolved conflicts