replaced print statements by logging statements