add test for tail recursion