Made some stupid mistakes with this one, but got it in the end.