finding inverse of matrix