replaced print statements with logging