code cleanup, removal of disabled old code, excess comments, test logs, etc
copy of script from before the cleanup