Add format routine in main.