typos, unused code deleted