fixed the bug in the code that returned a large negative value when computing max recursion depth