implemented a state machine test in the engine

state machine is a better name than engine stack :D