working on cache functions