Modified kernel, #define MATRIX_RANK