corrected main file