middle of matrix.c