Updated variable names and function inputs