offset logic changed