removing a few debug statements, functionality retained