Here I have 4 trees, each tiles knows which tiles are to the left, right, top and the bottom of them.
Now I begin erasing the duplicate tiles, as each tile is erased, the duplicate tile points all the other tiles around it to the non-duplicate.
So effectively, the tree sorta raps around itself, because the right side of the tree thinks it's to the left side of the tree which means when i iterate through the whole thing and get to the right side of the tree it'll go back to the left side and end up in a repetitive loop.
I did think of a solution, which would involve keeping track of tiles while iterating which would work in this case, but shift the tiles to the left by one and it would fail.