Done. Needs final cleanup and rewrite.