A first attempt at writing some Scala code.