if is tail-recursive