Going through exercises of Functional Programming in Scala