z_matrix