Update ex9.scala