Added print messages for debugging.