Created new function to determine matrix equivalence for getInverse function