main.cpp modified, next step is debug the program.