Adding caching to improvment speed