Added DFS in R