Have you tried changing the check for the shift modifier to that it checks if the shift modifier is present?
Currently you check if it is the only modifier.

In general: you have if statements that that do not handle all cases. If they do not trigger, their conditions are not met.
You can easily find out why by looking at the values using in these conditions. That's called debugging.

Cheers,
_