code for matrix inversion and cache