logging tweaks, changes to main script