added print statements for debugging purposes