moved print statements to debug