Formatting with state machine

this formatting is on top of dhruv's state machine PR