Added logging.  Cleaned up stuff.

It built so it must work, right?