change print statements to logging