added a demo for state transition