deleted some debugging code and added some comments