added chapter12_5.scala