clean up the main function