corrected typo and removed unused code