Just rewrite this shit!
More fixes than I can mention
SOOOO MANY CHANGES
SO MANY MORE CHANGES