added more print statements for debugging