modify for three_stage_sim