combined matrix.c