Updated logging and removed extra debugging statements.