typo and removed unused variables