learning Functional Programming in Scala