Racket solution to 1a.