first documentation and a few cleanups