more documentation and some minor fixes