Scala assignment 2