added caching and updated docs