updated all scripts to simplify logging and fix a few small bugs