reimplements the cache