Scala: Assignment 1