Added lots of debug crap
Lots of changes to make it faster. Most worked ok.