Finished debugging and validation code for the various pieces.

Now the code actually works.