move the print method to DFS