basic recursion solution