Racket implementation; doesn't work properly. I give up.