Potentiometer and switch added and dwitch changeover code completed