The changes I made so far.

I know the name looks shady. Sorry. I just called it that so that I
could pick either of the versions easily while testing changes and
breaking shit.