Major cleanup and debug

I realized that the way I was trying to do this sucked