added a function that validates whether a matrix contains an identity matrix