main corrected