final  phase1-code