code examples in Scala