Working code. says its working and switching. Have not tested all that
yet.