Rewrite everything

Rewrite everything.