added print statements to help debug