Scala Assignment 2