DFS works to completion, not sure if correct or optimal