recursion-function call for dfs (depth-first search)