moved debug/warning print statements to logging.warn/logging.debug statements