Functions to Calculate Inverse ofmatrix