MatrixSanityChecks function

Checks if the matrix is properly formatted