Added the NewStateMachine that uses a stack for the transitions.
NewStateMachine fixed.
Small fix to the NewStateMachine
Merge remote-tracking branch 'origin/artificial-intelligence' into artificial-intelligence-3