Minor cleanup plus addition of comments