Modified document to include the function var of the script