Made a large number of small changes, and added a number of comments
for Richard.