Added more to the "master logic" state machine (mostly stubbed out...)