prelim done with dfs