Added variables to the function.