modified Main.cpp