Preliminary version of this.