Passing recurse count as parameter instead of global variable