extensive documentation and bug fixes