Debugged a bunch. Still not done yet.

I think i may have messed up git's merging. Hopefully not.