Removed unused code and fixed spelling error