Update policy writing and fixed formatting