I see that this is solved, but if you keep going like this, you will get duplicates.
If you decide to use a pure function, you will not need this script (crossed out) and then could use a pure function where the green arrow is - instead of the array.
Apart from that, well done & good luck with the rest!