new tp code and bg switcher