Lots of comments a a few very minor code cleanups