start of SMACH state machine and viewer