Calculate offsets without static array