Updated logging and commented new code