added more debug
fixing log statements and reverting indents