Added code for cacheable matrix inverse calculation.