SICP exercises in Scala