fine tuning recursion