Removed some variable shadowing for legibility.