Removed unused variables and variable shadowing.