correct some comments and add some more debug statements