first pass of script and final results