matrix_setup