WIP #9 new double nested state machine for app & comparisons working.