added state machine diagram
state machine