log script and minor edits