Actually I was going to suggest an output of some kind, maybe an led. If MaskSwitch gets outside of your parameters in someway you could effectively end up in a main ... goto main loop.