removing some debug printfs, adding comments