fixed typo and removed dead code