added debug printouts