Changed detection strings to a switch statement