Added a static method to StateMachine.
Added *.swp files to .gitignore.