made some changes to main.cpp