CodeKata in Scala