Added a few debug statements for submission, found a few more bugs!