NSM State Machine