Rename some vars.

Move some code.
Remove some debug lines.
Make shit work.