debugged script.

Removed variables and fixed logical operators