Homework for Coursera Scala course