corrected some typos in code