added some initial code to turn on/off binary switch