calculating inverse of a matrix