Documented the code in cache.c