Matrix cache-ing code written