added a cache testing function