implemented State case class
first version of Candy machine