finalized the optimizer, added some tests to the optimizer, reran the docs