Move this into a separate file called MchStage and add comments to explain each stage