update documentation and code