Made some mostly minor edits and added comments.