some local variable name changes for sake of readability.