modify recursion