Final version.

Cleaned up a bit.