update length, longestPairLength, and offsets