Added a variable 'var2sub' within the function.