renamed unused variables properly
Merge pull request #2674 from akshaymohite/optimization-fixes

renamed unused variables properly