Added offset code