revised recursion