Started a total rewrite.