Sample codes from a Scala rookie