Scala Functional Programming and Collections