Functional programming in scala exercises