documentation and various enhancements