Much thanks to Alex for his help on this.