more documentation and test code