changing if-statements with switch