Changed some variable names for better understanding