tweak the calculation for offset