InvMat_Robust function

Robust method for matrix inversion