Functional programming in Scala Exercises