Konrad, Michael,
Many thanks. Managed to make it work! And the code block processes a list of 100+ values in seconds, when some of the monstrosities I’ve built out of nodes took ages! Just goes to show the inherent inefficiency of visual programming I guess.
The end result looks like this:
Best Regards.