Scala Course Homework