updating the cache functions and adding unit tests