added debugging print statements