Made some improvements suggested by Jay, mostly in the first two sections.