change print statements to log