Spaghetti fix again w/ debugging

I'm doing something wrong.
Also, adding debugging support.