Replaced some print with logging statements