added print statements for debugging