Update Chapter4Solution.scala