Working problem 3. Too much tail recursion?