Added Opt and tests.