Finishing touches.

Complies and runs. Hopefully everything actually works!