Added a ton of debugging code