Changed some variable names to avoid collisions