Tried to do it myself and finally got it to work, don’t know if it might be of some use to someone new. The code is a mess and some stuff is repeated a bit too much but for now it has to do.
Next up would be trying to brute force it and then maybe I could try my hand at galapagos.
Anyway, here’s the code if you want a laugh, my first script ever: