Changes to documentation as I am trying to get my head around the code.