fix syntax errors, add skeleton for mem_stage