Complete base implementation.

Currently it works only when n=2.