Scala implementation
Racket cleanup