fixed some typos added a few notes marked with XXX