Complete Rewrite. Resolves #1