added simple statemachine