"The ! (for not) does not work in $calc" I don't see a $calc anywhere in that script...