started on the DFS part, but get stackspace overflow, probably need strict to get somewhere, or perhaps I have an endless loop somewhere?