Added method for checking if the matrix is latin square