Created switch statements instead of if statements