added some debug printouts