Basic DFS implemented