Massive rewrite.