complete rewrite.