Added working regression code and tests.