Change to calculate inverse of matrix