Add statemachine
test wip