Create statemachine.cs