added print statements to find errors