more documentation and improvements