update to main.cpp