function to inverse a matrix
function to inverse a matrix