Finally got the state machine model worked out

Toooo many things to list