removed extra print statements and changed others
to log statements