Updated Script to use variables