How can I get input from a switch, ON/OFF, and use that to either enter a loop or exit a loop?