typos
typos in the code, add missing comments