Minor formatting and added log statements.
Added Comments