Spent 5 hours on this.