Most of the state machine is now implemented
changes