adding lesson 2 mode-switch routine