Some changes in main.cpp