Changed some variable names for clarification