finished basic function of cacheManager