Implemented DFS to solve challenge #3