written cached version of matrix inverse operation