Change conditions to switch