modified simple_switch code