updated main.cpp file to pause before exit