upate main.cpp