@mhBrice has some code for this.
@mhBrice has some code for this.