more documentation and compatibility with python2.6