Changed print statements to use a log function.