Added further print statements for debugging.