Added a bit more documentation

And some other minor changes.