Added copy of the %VAR declarations
Put in the endfunction statement