Training with Scala Functions