modefied main,c