This is what I get for rewriting this a day later.