How are Margins calculated