implement functions that decrease computation of matrices inversion