Working version for posterity.