Added switches for mode control