@SoftwareEngineer FWIW I didn'r see it as a criticism. Your solution is correct. Sometimes finding the balance on this site is halfway between telling someone (who is perhaps new to coding) how to do something, and teaching them how they might approach a solution. It's why I make a decent attempt to litter my code with comments, and pointers to documentation that they might useful in the future. It's the bane, and a pleasure, of being senior engineer to junior ones. —
Andy 40 secs ago