Feature complete rewrite