use trampoline to implement tail-call elimination.