offset calc modified