tail recursion in problem 11 works now