I tried to implement Joe’s solution in my original code but, unfortunately it didn’t give the right true/false values for me with MM. (not really sure why, Similarity didn’t work either)
I need the original data structure, so I left out flipping and cleaning the tree (only graft + shift at the end) and it works just like I wanted! (had to use ‘similarity’ there also as ‘equality’ was missing some lines)
So at the end I used a hybrid solution, but thank you for suggesting MM/MA, I didn’t even think about it!
Yes, it worked perfectly in this small code for me too, however when I implemented it in my original, bigger code it didn’t work the same (I couldn’t find out why, it has to do something with decimal places, but Similarity should have solved it )
It is a mistery why it works different, because I internalised the lines from the bigger code.
Anyways, it is working now, so thank your for the help Joseph!