Trying tail recursion