(define (add-to-end lst x) (if (null? lst) (list x) (cons (car lst) (add-to-end (cdr lst) x)))) (define (fact n) (if (<= n 1) 1 (* n (fact (- n 1))))) (define (fact-tail n) (define (helper n total) (if (= n 0) total (helper (- n 1) (* total n)))) (helper n 1))