Yet another implementation of this.