adding dfs code to start with