(define (sum xs) (if (null? xs) 0 (+ (car xs) (sum (cdr xs)))))
(define (list-from n) (if (> n 0) (cons n (list-from (- n 1))) '()))
(define (nth xs n) (if (= n 0) (car xs) (nth (cdr xs) (- n 1))))