complete documentation and add caching