Added checkmatrix.c