Coerced the code genetation, cleaning, and modification back into some sembalance of a working state.