Functional programming with Scala