fixed typos, added comments