New documentation and some work on the code