almost done with matrix.c