Update functions.scala