Partially working level switching. Need help