Created statemachine for Engine