documentation and some small improvements