updated StageA and StageB