Replaced print statements with log messages