Adjusted variable names in the function.