worked on gen_sym_stage_matrix