added caching for results