remove unused code
fix a misspelled variable name