Prepared files and renaming variables for the function.
Adjusted variable names and added conditional.
Added final variables, function, and conditional.