main formatting