moved print statements to debug logging