Lots of documentation and a few minor changes