Getting logic worked in, but switch doesn't wokr