@mluessi I've sped this up quite a bit from my original effort, but if you know a faster way than the one implemented here, let me know...