fix bug in recursion!!!

some debug output is present.
can consider to make it an command line option