Updated Scala example