modifyed cpp file,just as the final work