Modified the script with variables