Scala State Example