replaced print statements with logging statements.