changed lab3.scala