Corrected main.cpp using files existence checks