Optimize your tail-recursive functions