Homework for class: Functional Programming Principles in Scala