APPAPP HEADER: Added mode switch.