added code to stub methods for caching matrices