Issue with finding the cache matrix