Finished regeneralizing code. It still has broken edge cases, but no realistic ones.