Rewrite. Closes gh-8.