update

update
code state machine completed, review pending

Submitting for review, I am also reviewing, comments please