Added more comments, changes in plotting
minor change to logging to fix a newline issue