format code in main