Working version.

But many tests fail.