renamed a few variables for clarity