Nice!

BTW, I somehow got caught in an infinite loop and had to force close Brackets when testing this. I tried to find reproducable steps, but could not, so keep an eye out for that.