Finished OpitimizedDFS