At a quick glance it is your DEL i+1.
For the first line segment you will be deleting 2 transformations (1+1), for the second line segment you will be deleting 3 transformations (2+1), for the third 4 transformations (3+1), etc.
But you are only performing 2 transformations for each segment (ROT2 and ADD2)
Try just DEL 2.
Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11