clarified some comments and removed some debugging code.