refactored addTransition , global state functional