So of this is obviously a bit messy. (I know, because I wrote it.)