change print statements to loging statements