          for (let length = 1; length <= rawCopy.length; length++) {
                    if (rawIdx + length > rawCopy.length) {
                        break;
                    }
                    const mergedRaw = rawCopy.slice(rawIdx, rawIdx + length).join("");
                    const refWord = refList[refIdx];

                    if (mergedRaw.includes(refWord)) {
                        const parts = mergedRaw.split(refWord);
                        const limitedParts = [parts[0], mergedRaw.slic