Replaced print with logging