Functions defined to calculate Inverse of a matrix