updated to comply with the D3 'Margin Convention'