How to make a switch