working on moving to new state machine