Replaced print statements with logging statements.