Take margins into consideration