Scala programming assignment for Coursera