Much simpler way to do this.