Racket/Scheme code I used to write. I think it's from HTDP