swithd code