Clean up a lot of stupid stuff. Reformat most of the code.