added state machine and other goodies
Merge remote-tracking branch 'origin/JeffBranch' into RobBranch