Localized variables, tests still pass
Removed unnecessary local variables