tail call recursion works, but still too slow