changed the implementation of FiniteStateClass