Small changes to state machine - added getEndStates(), fixed variable
name (transition -> transitions)