Fixed execute permissions
Changed the way the variables are used