Changed some variable names for clarity