Much thanks to Syl Zembrzuski for this.