Beta version of statemachine
Updated the state diagram