added cacheSet and cacheGet methods and incorporated into methods