more documentation and comments