Finished rewrite, starting on testing